Changeset 3236

Show
Ignore:
Timestamp:
07/11/07 19:07:48 (1 year ago)
Author:
paul
Message:

Fixed a KeyError? in dTreeView's makeDirTree() function, thanks to a fix
by hraban in ticket #1076.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/stable/dabo/ui/uiwx/dTreeView.py

    r3054 r3236  
    784784     
    785785    def makeDirTree(self, dirPath, wildcard=None, showHidden=False): 
     786        """Make this dTreeView show a filesystem directory hierarchy. 
     787 
     788        Warning: Don't use this for huge hierarchies, as it blocks while 
     789        filling the complete tree, instead of only filling the nodes as 
     790        they are opened. 
     791        """ 
    786792        self.clear() 
    787793        # Add any trailing slash character 
     
    815821                        continue 
    816822                nd.appendChild(f) 
     823 
    817824        def sortNode(arg, currDir, fNames): 
    818             self.SortChildren(self._pathNode[currDir].itemID) 
     825            if currDir in self._pathNode: 
     826                self.SortChildren(self._pathNode[currDir].itemID) 
     827 
    819828        os.path.walk(dirPath, addNode, showHidden) 
    820829        os.path.walk(dirPath, sortNode, None) 
  • trunk/dabo/ui/uiwx/dTreeView.py

    r3054 r3236  
    784784     
    785785    def makeDirTree(self, dirPath, wildcard=None, showHidden=False): 
     786        """Make this dTreeView show a filesystem directory hierarchy. 
     787 
     788        Warning: Don't use this for huge hierarchies, as it blocks while 
     789        filling the complete tree, instead of only filling the nodes as 
     790        they are opened. 
     791        """ 
    786792        self.clear() 
    787793        # Add any trailing slash character 
     
    815821                        continue 
    816822                nd.appendChild(f) 
     823 
    817824        def sortNode(arg, currDir, fNames): 
    818             self.SortChildren(self._pathNode[currDir].itemID) 
     825            if currDir in self._pathNode: 
     826                self.SortChildren(self._pathNode[currDir].itemID) 
     827 
    819828        os.path.walk(dirPath, addNode, showHidden) 
    820829        os.path.walk(dirPath, sortNode, None)