def run(self, configfile, offset_file): self.offset_file = offset_file conf = formats.load_yaml(open(configfile).read()) updater = Updater(conf.get("lists")) infobase_log_url = "http://%s/openlibrary.org/log" % conf.get("infobase_server") self.read_changesets(infobase_log_url, updater.process_changesets)
def main(configfile): """Creates an updater using the config files and calls it with changesets read from stdin. Expects one changeset per line in JSON format. """ config = formats.load_yaml(open(configfile).read()) updater = Updater(config) changesets = (simplejson.loads(line.strip()) for line in sys.stdin) updater.process_changesets(changesets)
def update_lists(changeset): """Updates the lists database on edit. """ keys = [x['key'] for x in changeset['docs']] set_task_data(keys = keys, changeset = changeset['id']) logger.info("BEGIN update_lists: %s", changeset['id']) configfile = celeryconfig.OL_CONFIG ol_config = formats.load_yaml(open(configfile).read()) updater = ListUpdater(ol_config.get("lists")) updater.process_changeset(changeset, update_seeds=False) logger.info("END update_lists")
def main(config_file): config = formats.load_yaml(open(config_file).read()) init = Init(config) init.start()
def read_lists_config(self, configfile): conf = formats.load_yaml(open(configfile).read()) return conf.get("lists")
def update_support_from_email(): configfile = celeryconfig.OL_CONFIG ol_config = formats.load_yaml(open(configfile).read()) fetchmail(ol_config)