def connect_db(config): mydb = connect(host=config.db_host, user=config.db_user, password=config.db_password, database=config.db_name_scan, port=config.db_port, autocommit=True) cursor = mydb.cursor() queries = create_queries(config, cursor) return queries
with open("config/cache/gyms_full.json", encoding="utf-8") as f: full_gym_cache = json.load(f) with open("config/cache/gyms_empty.json", encoding="utf-8") as f: empty_gym_cache = json.load(f) with open("config/cache/edits.json", encoding="utf-8") as f: edit_list = json.load(f) with open("config/cache/deleted.json", encoding="utf-8") as f: deleted_cache = json.load(f) with open("config_example/cache/edits.json", encoding="utf-8") as f: empty_edit_list = json.load(f) queries = create_queries(config, cursor) init = init(queries) parser = argparse.ArgumentParser() parser.add_argument( "-i", "--init", action='store_true', help="Copy every missing Stop/Gym/Portal ID into Stop Watcher's cache files" ) parser.add_argument( "-d", "--delete", action='store_true', help= "Generates SQL Queries to delete possibly removed Waypoints from you Databases"
mydb = connect(host=config.db_host, user=config.db_user, password=config.db_password, database=config.db_name_scan, port=config.db_port, autocommit=True) cursor = mydb.cursor() mydb_p = connect(host=config.portal_db_host, user=config.portal_db_user, password=config.portal_db_password, database=config.db_name_portal, port=config.portal_db_port, autocommit=True) portal_cursor = mydb_p.cursor() queries = create_queries(config, cursor, portal_cursor) init = init(queries) parser = argparse.ArgumentParser() parser.add_argument( "-i", "--init", action='store_true', help="Copy every missing Stop/Gym/Portal ID into Stop Watcher's cache files" ) parser.add_argument( "-d", "--delete", action='store_true', help= "Generates SQL Queries to delete possibly removed Waypoints from you Databases"