diff --git a/src/timeforge/__main__.py b/src/timeforge/__main__.py index 282afdc..1aedc3c 100644 --- a/src/timeforge/__main__.py +++ b/src/timeforge/__main__.py @@ -18,7 +18,6 @@ def main(): """ This whole script was wrapped into a main function. This behaviour is mandatory to create an installable executable for pip """ - # TODO: better argument parsing including the support for a config file or a buffer parser = configargparse.ArgParser( prog='TimeForge', description='Create fake but realistic looking working time documentation for your student job at KIT', @@ -39,8 +38,6 @@ def main(): parser.add('-j', '--job', type=str, required=True, help='description of the job task') args = parser.parse_args() - ######################################### - if args.verbose: # print command line arguments core.PrintDictAsTable( @@ -83,8 +80,6 @@ def main(): # list of national holidays in the German state "Baden-Württemberg" feiertage_list = feiertage.Holidays(config.FEDERAL_STATE).get_holidays_list() - ######################################### - if args.verbose: core.PrintListAsTable(feiertage_list, "Calculated Holidays") @@ -104,8 +99,6 @@ def main(): form_data["hhmmRow" + str(table_row) + "_4"] = day.work_hours.strftime("%H:%M") table_row += 1 - ######################################### - if args.verbose: core.PrintDictAsTable(form_data, "PDF Form field", "Value") diff --git a/src/timeforge/core.py b/src/timeforge/core.py index 5967a75..a06623a 100644 --- a/src/timeforge/core.py +++ b/src/timeforge/core.py @@ -254,7 +254,7 @@ def pdf_content(self): @contextmanager def ProvideOutputFile(output_file: str): # store the online PDF in a temporary file which will automatically be deleted when this contextmanager will be left - with tempfile.TemporaryFile() as temp: + with tempfile.TemporaryFile(suffix=".pdf") as temp: # download online form and store it in a temp file try: