Skip to content

Commit 65e243f

Browse files
author
nthaihoc
committed
create template
1 parent 6de98d4 commit 65e243f

File tree

16 files changed

+42
-0
lines changed

16 files changed

+42
-0
lines changed

.github/workflows/.gitkeep

Whitespace-only changes.

config/config.yaml

Whitespace-only changes.

dvc.yaml

Whitespace-only changes.

params.yaml

Whitespace-only changes.

requirements.txt

Whitespace-only changes.

setup.py

Whitespace-only changes.

src/ccs/__init__.py

Whitespace-only changes.

src/ccs/components/__init__.py

Whitespace-only changes.

src/ccs/config/__init__.py

Whitespace-only changes.

src/ccs/config/configuration.py

Whitespace-only changes.

src/ccs/constants/__init__.py

Whitespace-only changes.

src/ccs/entity/__init__.py

Whitespace-only changes.

src/ccs/pipeline/__init__.py

Whitespace-only changes.

src/ccs/utils/__init__.py

Whitespace-only changes.

template.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import os
2+
from pathlib import Path
3+
import logging
4+
5+
#show logging string
6+
logging.basicConfig(level=logging.INFO, format='[%(asctime)s]: %(message)s:')
7+
8+
project_name = 'ccs'
9+
10+
list_of_file = [
11+
".github/workflows/.gitkeep",
12+
f"src/{project_name}/__init__.py",
13+
f"src/{project_name}/components/__init__.py",
14+
f"src/{project_name}/utils/__init__.py",
15+
f"src/{project_name}/config/__init__.py",
16+
f"src/{project_name}/config/configuration.py",
17+
f"src/{project_name}/pipeline/__init__.py",
18+
f"src/{project_name}/entity/__init__.py",
19+
f"src/{project_name}/constants/__init__.py",
20+
"config/config.yaml",
21+
"dvc.yaml",
22+
"params.yaml",
23+
"requirements.txt",
24+
"setup.py",
25+
"templates/index.html"
26+
]
27+
28+
for filepath in list_of_file:
29+
filepath = Path(filepath)
30+
filedir, filename = os.path.split(filepath)
31+
32+
if filedir != "":
33+
os.makedirs(filedir, exist_ok=True)
34+
logging.info(f"Creating directory: {filedir} for the file: {filename}")
35+
36+
if (not os.path.exists(filepath)) or (os.path.getsize(filepath) == 0):
37+
with open(filepath, "w") as f:
38+
pass
39+
logging.info(f"Creating empty file: {filepath}")
40+
41+
else:
42+
logging.info(f"{filename} is already exists")

templates/index.html

Whitespace-only changes.

0 commit comments

Comments
 (0)