Module conddbui :: Class Tag
[show private | hide private]
[frames | no frames]

Class Tag


Basic class allowing to manipulate more easily the tags in the tag hierarchy. The rule is that a tag has only one child tag and can have many parent tag.
Method Summary
  __init__(self, tagName, nodePath)
Create a new tag object.
  __repr__(self)
Standard object representation.
  __str__(self)
Standard string conversion.
  connectChild(self, child)
Connect a child tag to the current tag, and update the parent list of the child.
  getAncestors(self)
Return the names of the ancestor tags.
  getAncestorsBranches(self, currentBranche, brancheList)
Recursive function returning the list of ancestor branchs of the tag.
  getAncestorTags(self)
Return the ancestor tags as a list of tag objects.
  getAncestorTagsDict(self, currentBranche, brancheList)
Recursive function returning the list of ancestor tags dictionaries.
  printAncestors(self, branche)
Recursive function printing the relation between the tag and its ancestors.

Method Details

__init__(self, tagName, nodePath)
(Constructor)

Create a new tag object.
inputs:
    tagName:  string; name of the tag
    nodePath: string; path to the node which own this tag
outputs:
    none

__repr__(self)
(Representation operator)

Standard object representation. Returns a string representation of all the object's attributes, as well as its relations with its ancestors.

__str__(self)
(Informal representation operator)

Standard string conversion. Returns the name of the tag

connectChild(self, child)

Connect a child tag to the current tag, and update the parent list of the child.
inputs:
    child: Tag object; the child tag object
outputs:
    none

getAncestors(self)

Return the names of the ancestor tags.
inputs:
    none
outputs:
    ancestors: list of strings; the names of all the ancestor
               tags of the current tag. This is equivalent to
               a list of aliases for this tag.

getAncestorsBranches(self, currentBranche=[], brancheList=None)

Recursive function returning the list of ancestor branchs of the tag.
inputs:
    currentBranche: list of strings; stores the names of the ancestors
                    of the current branch.
                    -> Default = []
    brancheList:    list of lists of strings; variable storing the list
                    of completed ancestor branches.
                    -> Default = None
outputs:
    brancheList: list of list of strings; each sublist contains a branch of
                 the tag "family".

getAncestorTags(self)

Return the ancestor tags as a list of tag objects.
inputs:
    none
outputs:
    ancestors: list of tags; all the ancestor tags of the
               current tag.

getAncestorTagsDict(self, currentBranche={}, brancheList=None)

Recursive function returning the list of ancestor tags dictionaries.
inputs:
    currentBranche: dictionary of tags; stores the the ancestors tags,
                    referenced by names, for the current branch.
                    -> Default = {}
    brancheList:    list of dictionaries; variable storing the list
                    of completed ancestor branches.
                    -> Default = None
outputs:
    brancheList: list of dictionaries; each sublist contains a branch of
                 the tag "family".

printAncestors(self, branche='')

Recursive function printing the relation between the tag and its ancestors.
inputs:
    branche: string; current status of the ancestor branch. If other ancestors
             exist, this value is updated. Otherwise, it is printed.
             -> Default = ''
outputs:
    none; results are sent to the standard output.

Generated by Epydoc 2.1 on Tue Mar 6 18:29:23 2007 http://epydoc.sf.net