Skip to content

Commit

Permalink
added src
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeeyoungkim committed Apr 13, 2024
1 parent 950c7e5 commit 9a15ffd
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ run
paramkey.txt
*.log
__pycache__/
src
.env
Empty file added python/fastapi/src/__init__.py
Empty file.
17 changes: 17 additions & 0 deletions python/fastapi/src/utils.py
Original file line number Diff line number Diff line change
@@ -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}"
Empty file.
17 changes: 17 additions & 0 deletions python/fastapi_demo/src/utils.py
Original file line number Diff line number Diff line change
@@ -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}"

0 comments on commit 9a15ffd

Please sign in to comment.