def run_and_dump(name, obj, __checksum__=None, **kw): adapter = get_adapter(obj, interfaces.IOperation, name=name) if __checksum__: cached = path_from_checksum(__checksum__, outdir=CACHE_DIR) if cached.exists(): return load(cached, cls=adapter.returns), __checksum__ res = adapter(**kw) out = dump(res, outdir=CACHE_DIR) return res, as_unicode(out.stem)
def write(name, obj, _outdir=None, _stem=None, **kw): adapter = get_adapter(obj, interfaces.IWriter, name=name) outfile = _outdir.joinpath(path_component('{0}.{1}'.format(_stem, name))) adapter.write(outfile, **kw) file_written(outfile) return outfile
def get(name, obj, **kw): adapter = get_adapter(obj, interfaces.IWriter, name=name) return adapter.get(**kw)
def read(name, interface, obj, **kw): adapter = get_adapter(readbase.wrapped(obj), get_interface(interface), name=name) return adapter(**kw)
def run(name, obj, **kw): adapter = get_adapter(obj, interfaces.IOperation, name=name) return adapter(**kw)