Ejemplo n.º 1
0
 def openList(self):
     try:
         #----------------------------------------
         # A hack for locally-encoded filesystems:
         # We need to convert filesystem names
         # from local encoding to unicode
         if type(self.resourcepath) is str:
             files = os.listdir(
                 self.resourcepath.decode(sys.getfilesystemencoding()))
         else:  # unicode or other
             files = os.listdir(self.resourcepath)
         #----------------------------------------
     except Exception, err:
         raise ExplorerNodes.TransportError(err)
Ejemplo n.º 2
0
def findFileExplorerNode(category, respath, transports):
    for tp in transports.entries:
        if tp.itemProtocol == 'file':
            return tp.getNodeFromPath(respath, forceFolder=False)
    raise ExplorerNodes.TransportError(
        _('FileSysCatNode not found in transports %s') % transports.entries)