def invalidate(bookid, **kw): config = configure(**kw) url = config.get("invalidate_url") data = dict(bookid=bookid) log.debug("sending invalidating request: %r to %s", data, url) client = Client(url) return client.send(data)
def configure(**kw): config = library.configure(**kw) src_path = config.get('src_path') store_url = config.get('store_url') cache_url = config.get('cache_url') max_entries = config.get('max_entries') register_source(src_path) register_store(store_url, cache_url, max_entries=max_entries) return config
def update(bookid, **kw): config = configure(**kw) base = config.get('src_path') prefix = 'file:/' if base.startswith(prefix): base = base[len(prefix)-1:] base = os.path.realpath(base) if not os.path.exists(base): raise ValueError('Path not found: %s', base) svn = SvnCommand(base) return svn.up(bookid)
def main(): config = configure() d = Dispatcher(config.get('broker_url')) d.run()