def deleted(otype): otypes = Names.getnames(otype, [otype,]) for t in otypes: for fn in fns(t): o = hook(fn) if "_deleted" not in o or not o._deleted: continue yield fn, o
def every(selector=None, index=None, timed=None): nr = -1 if selector is None: selector = {} for otype in os.listdir(os.path.join(cfg.wd, "store")): for fn in fns(otype, timed): o = hook(fn) if selector and not search(o, selector): continue if "_deleted" in o and o._deleted: continue nr += 1 if index is not None and nr != index: continue yield fn, o
def all(otype, selector=None, index=None, timed=None): nr = -1 if selector is None: selector = {} otypes = Names.getnames(otype, [otype,]) for t in otypes: for fn in fns(t, timed): o = hook(fn) if selector and not search(o, selector): continue if "_deleted" in o and o._deleted: continue nr += 1 if index is not None and nr != index: continue yield fn, o
def find(otype, selector=None, index=None, timed=None): if selector is None: selector = {} otypes = Names.getnames(otype, [otype,]) got = False nr = -1 for t in otypes: for fn in fns(t, timed): o = hook(fn) if selector and not search(o, selector): continue if "_deleted" in o and o._deleted: continue nr += 1 if index is not None and nr != index: continue got = True yield (fn, o) if not got: return (None, None)
def lastfn(otype): fn = fns(otype) if fn: fnn = fn[-1] return (fnn, hook(fnn)) return (None, None)
def lasttype(otype): fnn = fns(otype) if fnn: return hook(fnn[-1])