Skip to content

Commit

Permalink
tempfile can now be identified
Browse files Browse the repository at this point in the history
  • Loading branch information
MitchiLaser committed Sep 11, 2023
1 parent bf6bbdb commit cd170f3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 0 additions & 7 deletions src/timeforge/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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(
Expand Down Expand Up @@ -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")

Expand All @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion src/timeforge/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit cd170f3

Please sign in to comment.