Beispiel #1
0
 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)
Beispiel #2
0
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)
Beispiel #3
0
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)
Beispiel #4
0
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")
Beispiel #5
0
def main(config_file):
    config = formats.load_yaml(open(config_file).read())
    init = Init(config)
    init.start()
Beispiel #6
0
 def read_lists_config(self, configfile):
     conf = formats.load_yaml(open(configfile).read())
     return conf.get("lists")
Beispiel #7
0
def update_support_from_email():
    configfile = celeryconfig.OL_CONFIG
    ol_config = formats.load_yaml(open(configfile).read())
    fetchmail(ol_config)