From 9a15ffd74798dd7b66f99f245cff909951d59a2a Mon Sep 17 00:00:00 2001 From: jykim Date: Sat, 13 Apr 2024 15:46:22 +0900 Subject: [PATCH] added src --- .gitignore | 1 - python/fastapi/src/__init__.py | 0 python/fastapi/src/utils.py | 17 +++++++++++++++++ python/fastapi_demo/src/__init__.py | 0 python/fastapi_demo/src/utils.py | 17 +++++++++++++++++ 5 files changed, 34 insertions(+), 1 deletion(-) create mode 100755 python/fastapi/src/__init__.py create mode 100755 python/fastapi/src/utils.py create mode 100755 python/fastapi_demo/src/__init__.py create mode 100755 python/fastapi_demo/src/utils.py diff --git a/.gitignore b/.gitignore index 20a2c145..f15d4b72 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,4 @@ run paramkey.txt *.log __pycache__/ -src .env diff --git a/python/fastapi/src/__init__.py b/python/fastapi/src/__init__.py new file mode 100755 index 00000000..e69de29b diff --git a/python/fastapi/src/utils.py b/python/fastapi/src/utils.py new file mode 100755 index 00000000..9cc62ef9 --- /dev/null +++ b/python/fastapi/src/utils.py @@ -0,0 +1,17 @@ +from pathlib import Path +import os + + +def get_project_dir(): + return Path(__file__).parent.parent + +def get_pid(): + return os.getpid() + +def check_path(paths: list): + for path in paths: + if os.path.exists(path) is False: + os.mkdir(path) + +def target_url(domain, path): + return f"{domain}/{path}" diff --git a/python/fastapi_demo/src/__init__.py b/python/fastapi_demo/src/__init__.py new file mode 100755 index 00000000..e69de29b diff --git a/python/fastapi_demo/src/utils.py b/python/fastapi_demo/src/utils.py new file mode 100755 index 00000000..9cc62ef9 --- /dev/null +++ b/python/fastapi_demo/src/utils.py @@ -0,0 +1,17 @@ +from pathlib import Path +import os + + +def get_project_dir(): + return Path(__file__).parent.parent + +def get_pid(): + return os.getpid() + +def check_path(paths: list): + for path in paths: + if os.path.exists(path) is False: + os.mkdir(path) + +def target_url(domain, path): + return f"{domain}/{path}"