Logo Search packages:      
Sourcecode: gallery-uploader version File versions  Download package

def guplib::albums::AlbumList::tree (   self,
  level = 0,
  branch = None 
)

Return tuples with information about the album list to be
displayed in a tree fashion. The tuples are in the format (level,
name, id), where "level" is the tree node level of the album;
albums with the same level are siblings and albums preceding a
lower level are child of the previous one.

The parameters "level" and "branch" shouldn't be used directly,
unless you are completely sure about that.

Definition at line 141 of file albums.py.

00141                                             :
        '''Return tuples with information about the album list to be
        displayed in a tree fashion. The tuples are in the format (level,
        name, id), where "level" is the tree node level of the album;
        albums with the same level are siblings and albums preceding a
        lower level are child of the previous one.
        
        The parameters "level" and "branch" shouldn't be used directly,
        unless you are completely sure about that.'''
        if branch is None:
            branch = self.start
        yield (level, branch.name, branch.album_id)

        ordered_child = branch.child.values()
        ordered_child.sort()

        # this is SO ugly!
        for child in ordered_child:
            for result in self.tree(level+1, child):
                yield result

    def orphans(self):


Generated by  Doxygen 1.6.0   Back to index