From 6268f2c90877f73b1717ee677c1880e00c1299c8 Mon Sep 17 00:00:00 2001 From: gregory Date: Thu, 13 Mar 2025 12:01:05 -0400 Subject: [PATCH] clean up --- .gitignore | 3 +-- save_progress_reports.py | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index fe66201..cd19643 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ .venv -tmp -output \ No newline at end of file +tmp \ No newline at end of file diff --git a/save_progress_reports.py b/save_progress_reports.py index b437ad6..5b13421 100644 --- a/save_progress_reports.py +++ b/save_progress_reports.py @@ -19,12 +19,11 @@ GECKO_DRIVER = 'gecko' CHROME_DRIVER = 'chrome' DEFAULT_CONFIG_PATH = './config.ini' DEFAULT_OUTPUT_PATH = './' +DEFAULT_WORKING_DIRECTORY = './tmp' DEFAULT_APP_URL = 'https://app.flightschedulepro.com' DEFAULT_TIMEOUT = 10 #seconds DEFAULT_MAX_SESSIONS = 500 -# HACK maybe Ubuntu specific -os.environ["TMPDIR"] = "./tmp" parser = argparse.ArgumentParser( prog='FSP Progress Combiner', @@ -43,7 +42,7 @@ args = parser.parse_args() config = configparser.ConfigParser() config.read(args.config) -working_dir = config['main']['working_directory'] +working_dir = config['main'].get('working_directory', DEFAULT_WORKING_DIRECTORY) app_url = config['main'].get('app_url', DEFAULT_APP_URL) timeout = config['main'].get('timeout', DEFAULT_TIMEOUT) @@ -56,6 +55,9 @@ except OSError as exception: for f in files: os.remove(f) +# HACK maybe Ubuntu specific +os.environ["TMPDIR"] = working_dir + driver_type = config['main']['driver'] # TODO only firefox for now if driver_type == GECKO_DRIVER: