def new_values(basenames): """Get date, size and md5sum for those basenames in $HOME""" result = {} for basename in basenames: p = home() / basename if not p.isfile(): continue size = '%d' % p.size mtime = '%0.8f' % p.mtime m = hashlib.md5() m.update(p.text()) result[basename] = Signature(mtime, size, m.hexdigest()) return pad_keys(result, basenames)
def from_home(p): return home().relpathto(p)
def all_directories_in_a_list_of_tags(tags): """Get a sorted list of all the directories mentioned in the given tags""" return sorted({paths.home().relpathto(t.path.parent) for t in tags})