Ejemplo n.º 1
0
Archivo: ufsFs.py Proyecto: weijia/ufs
 def listNamedChildren(self, start = 0, cnt = None, getParent = True):
     #Return {fullPath:name}
     db = dbSys.dbSysSmart()
     co = collectionManager.getCollection(u"ufsFs://"+self.id, db).getRange(0, None)
     #res = {getUfsUuidItemUrl(self.id):getUfsUuidItemUrl(self.id)}
     res = {}
     #res["test"] = co
     ns = nameService.nameService(db.getNameServiceDb())
     for i in co:
         n = ns.getName(i)
         if n is None:
             n = i
         res[i] = objTools.getUfsBasename(n)
     return res
Ejemplo n.º 2
0
Archivo: ufsV2.py Proyecto: weijia/ufs
 def listNamedChildren(self, start = 0, cnt = None, getParent = True):
     #Return {fullPath:name}
     db = dbSys.dbSysSmart()
     #print "retriving co:", getUfsUuidItemUrl(self.id)
     co = collectionManager.getCollection(getUfsUuidItemUrl(self.id), db).getRange(0, None)
     #res = {getUfsUuidItemUrl(self.id):getUfsUuidItemUrl(self.id)}
     #res = {}
     #print "got co:", co
     res = odict.OrderedDict()
     #res["test"] = co
     #Hard code the freq items
     res[u"freq://root"] = u"Freqently Used"
     #Hard code the tag system
     res[u"tag://,"] = u"Tag System"
     #Hard code the task system
     res[u"tasklist://,"] = u"Task List"
     #Hard code the task system
     res[u"zippedColllectionWithInfo://,"] = u"Zipped Collections"
     #Storage List
     res[u"storage://"] = u"Storages"
     #Add other item in root item
     ns = nameService.nameService(db.getNameServiceDb())
     for i in co:
         n = ns.getName(i)
         if n is None:
             try:
                 #Get url
                 n = objTools.getUrlContent(i)
             except ValueError:
                 n = None
         if n is None:
             #Seems to be a directory path
             try:
                 n = objTools.getUfsBasename(i)
             except:
                 n = None
         if n is None:
             n = i
         res[i] = n
     if localDriverExist():
         res[u"winUfs"+configurationTools.getFsProtocolSeparator()+winUfs.winUfsRootItemUuid] = u"Filesystem"
     return res