def expandToPath(self, path, glock=True): """ @summary: Expand row at path, expanding any ancestors as needed. @param path: Path to expand. @param glock: True to look gtk-loop. Default True. """ UIUtils.expandTreeview(self.__explorer__, path, glock)
def __expandPath__ (self, path, select): """ @summary: Expand a path on navigator TreeView. @param path: Path to expand. @param select: True to select TreeIter. """ head, dir = os.path.split(path) iter = None if (path == os.path.expanduser("~")): __log__.debug("Expanding home directory...") iter = self.__findDirectoryOnParent__(None, self.__HOME_NODE__) elif(head == path): # If head is equal path, path is a drive or mount point iter = self.__findDirectoryOnParent__(None, head) if (iter == None): iterparent = self.__expandPath__ (head, False) if (iterparent != None): iter = self.__findDirectoryOnParent__ (iterparent, dir) if (iter != None): treepath = self.__model__.get_path(iter) self.__fillDirectory__(treepath) if (select): UIUtils.expandTreeview(self.__explorer__, treepath) selection = self.__explorer__.get_selection() selection.select_path(treepath) UIUtils.scrollTreeviewToPath(self.__explorer__, treepath) return iter