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: