Skip to content

Commit

Permalink
added "if __name__=="__main__":" guard
Browse files Browse the repository at this point in the history
  • Loading branch information
9FS committed Nov 5, 2023
1 parent 160e0a2 commit 8914ce3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license = "MIT"
name = "x" # can't leave empty because of bug with `poetry install` from poetry.lock file
readme = "readme.md"
repository = "https://github.com/9-FS/2021-12-22-Filename-Dateformat-Changer"
version = "1.1.0"
version = "1.1.1"

[tool.poetry.dependencies]
kfsconfig = "^1.0.0"
Expand Down
25 changes: 13 additions & 12 deletions src/main_outer.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# Copyright (c) 2023 구FS, all rights reserved. Subject to the MIT licence in `licence.md`.
from KFSlog import KFSlog
import logging
import traceback
from main import main
if __name__=="__main__":
from KFSlog import KFSlog
import logging
import traceback
from main import main


KFSlog.setup_logging("", logging.INFO)
#KFSlog.setup_logging("", logging.DEBUG, filepath_format="./log/%Y-%m-%dT%H_%M.log", rotate_filepath_when="M")
KFSlog.setup_logging("", logging.INFO)
#KFSlog.setup_logging("", logging.DEBUG, filepath_format="./log/%Y-%m-%dT%H_%M.log", rotate_filepath_when="M")

try:
main()
except:
logging.critical(traceback.format_exc())
print("\nPress enter to close program.", flush=True)
input() # pause
try:
main()
except:
logging.critical(traceback.format_exc())
print("\nPress enter to close program.", flush=True)
input() # pause

0 comments on commit 8914ce3

Please sign in to comment.