コード例 #1
0
ファイル: intel_watcher.py プロジェクト: crhbetz/intelwatcher
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
コード例 #2
0
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"
コード例 #3
0
ファイル: stop_watcher.py プロジェクト: ccev/stopwatcher
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"