Ejemplo n.º 1
0
def main() -> None:
    '''Main entrypoint.'''
    parser = argparse.ArgumentParser(description='Tags standardization.')

    db.configure_parser(parser)
    logs.configure_parser(parser)

    args = parser.parse_args()
    logs.init(parser.prog, args)

    logging.info('Started')
    dbconn = db.connect(db.DatabaseConnectionArguments.from_args(args))
    try:
        standardize_tags(dbconn)
        dbconn.conn.commit()
    except:  # noqa: bare-except
        logging.exception('Failed to standardize tags.')
    finally:
        dbconn.conn.close()
        logging.info('Finished')
Ejemplo n.º 2
0
def main() -> None:
    '''Main entrypoint.'''
    parser = argparse.ArgumentParser(description='Tags standardization.')

    db.configure_parser(parser)
    logs.configure_parser(parser)

    args = parser.parse_args()
    logs.init(parser.prog, args)

    logging.info('Started')
    dbconn = db.connect(args)
    warnings.filterwarnings('ignore', category=dbconn.Warning)
    try:
        standardize_tags(dbconn)
        dbconn.commit()
    except:  # noqa: bare-except
        logging.exception('Failed to standardize tags.')
    finally:
        dbconn.close()
        logging.info('Finished')
Ejemplo n.º 3
0
def main() -> None:
    '''Main entrypoint.'''
    parser = argparse.ArgumentParser(
        description='Migrate canonical tags.')

    db.configure_parser(parser)
    logs.configure_parser(parser)

    args = parser.parse_args()
    logs.init(parser.prog, args)

    logging.info('Started')
    dbconn = db.connect(args)
    try:
        mapping = get_inverse_mapping(dbconn)
        migrate_tags(dbconn, mapping)
        dbconn.commit()
    except:  # noqa: bare-except
        logging.exception('Failed to migrate canonical tags.')
    finally:
        dbconn.close()
        logging.info('Finished')