Ejemplo n.º 1
0
 def matchId(id):
     """ Return all IDs that starts with 'id'
     """
     cmd = 'find %s -name .git -prune -o -name "%s*" -type f -print'
     cmd = cmd % (XmlStorage.dataDir, id)
     stat, lines = applib.get_status_text_output(cmd)
     ids = list(map(os.path.basename, lines))
     return ids
Ejemplo n.º 2
0
 def matchId(id):
     """ Return all IDs that starts with 'id'
     """
     cmd = 'find %s -name .git -prune -o -name "%s*" -type f -print'
     cmd = cmd % (XmlStorage.dataDir, id)
     stat, lines = applib.get_status_text_output(cmd)
     ids = list(map(os.path.basename, lines))
     return ids
Ejemplo n.º 3
0
 def idToPath(id):
     """ Find and return the absolute path of a record
     """
     cmd = 'find %s -name %s' % (XmlStorage.dataDir, id)
     stat, lines = applib.get_status_text_output(cmd)
     if stat and lines:
         return lines[0]
     else:
         return None
Ejemplo n.º 4
0
 def idToPath(id):
     """ Find and return the absolute path of a record
     """
     cmd = "find %s -name %s" % (XmlStorage.dataDir, id)
     stat, lines = applib.get_status_text_output(cmd)
     if stat and lines:
         return lines[0]
     else:
         return None