if __name__ == "__main__":
- PSQL_PARAMS = ["dbname", "user", "password", "host", "port", "service"]
-
def tracker_name(val):
matches = [n for n in TRACKERS.keys() if n.lower() == val.lower()]
if matches:
help = "delay between batches, in seconds",
)
- for arg_name in PSQL_PARAMS:
- parser.add_argument("--" + arg_name, nargs = "?")
-
args = parser.parse_args()
tracker = TRACKERS[args.tracker]
delay = dt.timedelta(seconds = args.delay)
- params = {n: getattr(args, n) for n in PSQL_PARAMS if getattr(args, n)}
- with contextlib.closing(psycopg2.connect(**params)) as conn:
+ with contextlib.closing(psycopg2.connect("")) as conn:
conn.autocommit = True
db_wrapper = DbWrapper(conn)
passkey = db_wrapper.get_passkey(tracker.gazelle_id)