-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate.py
executable file
·52 lines (49 loc) · 1.41 KB
/
create.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import os
# Estrutura de diretórios e arquivos
structure = {
"project": {
"backend": {
"app": {
"api": ["poses.py"],
"services": ["pose_analysis.py"],
"utils": ["helpers.py"],
"__init__.py": ""
},
"main.py": "",
"Dockerfile": "",
"requirements.txt": ""
},
"frontend": {
"public": [],
"src": {
"components": ["Upload.js"],
"pages": ["Home.js"],
"App.js": ""
},
"Dockerfile": "",
"package.json": "",
"yarn.lock": ""
},
"database": {
"init.sql": "",
"Dockerfile": ""
},
"docker-compose.yml": "",
"Makefile": "",
"README.md": ""
}
}
def create_structure(base_path, structure):
for name, content in structure.items():
path = os.path.join(base_path, name)
if isinstance(content, dict):
os.makedirs(path, exist_ok=True)
create_structure(path, content)
elif isinstance(content, list):
os.makedirs(path, exist_ok=True)
for file in content:
open(os.path.join(path, file), 'a').close()
else:
open(path, 'a').close()
# Cria a estrutura de diretórios e arquivos
create_structure(".", structure)