Ejemplo n.º 1
0
def gbrv_generate(options):
    """Generate the GBRV output databases."""

    # FIXME bugme with workdir
    for cls in GbrvOutdb.__subclasses__():
        outdb = cls.new_from_dojodir(options.dojo_dir)
        if os.path.exists(outdb.filepath):
            print("File %s already exists! " "New file won't be created. Remove it and try again" % outdb.basename)
        else:
            outdb.json_write()
            print("Written new database %s" % outdb.basename)

    return 0
Ejemplo n.º 2
0
def gbrv_update(options):
    """Update the databases in dojo_dir."""

    for cls in GbrvOutdb.__subclasses__():
        filepath = os.path.join(options.dojo_dir, cls.basename)
        if not os.path.exists(filepath):
            continue

        outdb = cls.from_file(filepath)

        print("Checking:", outdb.basename)
        u = outdb.check_update()
        print("Update report:", u)

    return 0