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
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
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