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