Changeset 4694

Show
Ignore:
Timestamp:
11/01/08 06:54:36 (2 months ago)
Author:
merlimat
Message:

Corrected error with hierarchical pages (using '/' as separator).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • eclipsetracplugin/tracrpcext/0.10/tracrpcext/wiki.py

    r4693 r4694  
    7070        children = {} 
    7171        for page in pages: 
     72            # print 'Complete name: "%s"' % page 
    7273            relname = page.replace( pagename, '' ) 
     74            # print 'RELNAME: "%s"' % relname 
     75              
    7376            if relname.find( '/' ) == -1: 
    7477                # We only look for direct children 
     
    7780            else: 
    7881                # The page does not really exists, but it does have 
    79                 # children, so we have to return it,  
     82                # children, so we have to return it, 
    8083                name = pagename + relname.split( '/', 1 )[0] 
    81                 children[ name ] = { 'exists' : False,  
    82                                      'hasChildren' : True } 
     84                if not children.has_key( name ): 
     85                    children[ name ] = { 'exists' : False,  
     86                                        'hasChildren' : True } 
     87                else: 
     88                    children[ name ][ 'hasChildren' ] = True 
     89                     
    8390        return children 
    8491