Skip to content

Commit 89554bc

Browse files
committed
first commit
0 parents  commit 89554bc

File tree

2 files changed

+199
-0
lines changed

2 files changed

+199
-0
lines changed

main.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# python main.py "/path/to/directory" "/path/to/output/file"
2+
3+
import os
4+
import argparse
5+
6+
IGNORED_DIRECTORIES = ['node_modules', 'venv', '.git', '.next']
7+
8+
def create_directory_map(path, indent=''):
9+
file_tree = ""
10+
files = os.listdir(path)
11+
files.sort()
12+
13+
standalone_files = []
14+
15+
for i, file in enumerate(files):
16+
file_path = os.path.join(path, file)
17+
if os.path.isdir(file_path):
18+
if file not in IGNORED_DIRECTORIES:
19+
file_tree += f"{indent}|\n"
20+
file_tree += f"{indent}|───{file}\n"
21+
file_tree += create_directory_map(file_path, indent + '| ')
22+
else:
23+
standalone_files.append(file)
24+
25+
if standalone_files:
26+
for file in standalone_files:
27+
file_tree = f"{indent}| {file}\n{file_tree}"
28+
29+
return file_tree
30+
31+
def write_directory_map_to_file(path, output_file):
32+
file_tree = create_directory_map(path)
33+
34+
parent_directory = os.path.basename(path)
35+
parent_directory = parent_directory.replace('_', ' ')
36+
parent_directory = parent_directory.replace('-', ' ')
37+
parent_directory = parent_directory.title()
38+
39+
file_tree = f"{parent_directory}\n{file_tree}"
40+
41+
with open(output_file, 'w', encoding='utf-8') as file:
42+
file.write(file_tree)
43+
44+
if __name__ == '__main__':
45+
parser = argparse.ArgumentParser(description='Generate directory map.')
46+
parser.add_argument('directory_path', help='Path to the directory to map')
47+
parser.add_argument('output_file', help='Output file to write the directory map')
48+
49+
args = parser.parse_args()
50+
51+
directory_path = args.directory_path
52+
output_file = args.output_file
53+
54+
write_directory_map_to_file(directory_path, output_file)

output.txt

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
Learning Latin
2+
| tsconfig.json
3+
| tailwind.config.js
4+
| postcss.config.js
5+
| package.json
6+
| package-lock.json
7+
| next.config.js
8+
| next-env.d.ts
9+
| README.md
10+
| LICENSE
11+
| .gitmodules
12+
| .gitignore
13+
| .env.local
14+
|
15+
|───.vscode
16+
| | settings.json
17+
|
18+
|───components
19+
| | translationCard.tsx
20+
| | toolTip.tsx
21+
| | text.tsx
22+
| | nav.tsx
23+
| | layout.tsx
24+
| | chartFooter.tsx
25+
| | chart.tsx
26+
| | button.tsx
27+
|
28+
|───lib
29+
| |
30+
| |───data
31+
| | | macronList.ts
32+
| | |
33+
| | |───practice
34+
| | | | relative-pronouns.ts
35+
| | | | personal-pronouns.ts
36+
| | | | personal-endings.ts
37+
| | | | perfect-tense.ts
38+
| | | | future-tense.ts
39+
| | | | declensions.ts
40+
| |
41+
| |───hooks
42+
| | | useScroll.ts
43+
| |
44+
| |───types
45+
| | | textProps.ts
46+
| | | resourceProps.ts
47+
| | | chartProps.ts
48+
| | | buttonProps.ts
49+
| |
50+
| |───utils
51+
| | | removeExtraSpaces.ts
52+
| | | macronHandler.ts
53+
| | | createValueArrayMap.ts
54+
| | | clearChart.ts
55+
| | | checkForMacrons.ts
56+
| | | chartClearable.ts
57+
| | | changeTextAccuracyState.ts
58+
|
59+
|───pages
60+
| | translate.tsx
61+
| | practice.tsx
62+
| | notes.tsx
63+
| | index.tsx
64+
| | _app.tsx
65+
| |
66+
| |───api
67+
| | | translate.ts
68+
| | |
69+
| | |───Open-Words-TS
70+
| | | | tsconfig.json
71+
| | | | search.ts
72+
| | | | problems.txt
73+
| | | | package.json
74+
| | | | package-lock.json
75+
| | | | README.md
76+
| | | | LICENSE
77+
| | | | .gitignore
78+
| | | | .git
79+
| | | |
80+
| | | |───.github
81+
| | | | |
82+
| | | | |───ISSUE_TEMPLATE
83+
| | | | | | config.yml
84+
| | | | | | WordNotFound.yml
85+
| | | | | | Suggestion.yml
86+
| | | |
87+
| | | |───data
88+
| | | | | suffixes.txt
89+
| | | | | prefixes.txt
90+
| | | | | data.json
91+
| | | | | UNIQUES.LAT
92+
| | | | | STEMLIST.GEN
93+
| | | | | INFLECTS.LAT
94+
| | | | | EWDSLIST.GEN
95+
| | | | | DICTLINE.GEN
96+
| | | | | ADDONS.LAT
97+
| | | | |
98+
| | | | |───converters
99+
| | | | | | CreateEnglish.py
100+
| | | |
101+
| | | |───src
102+
| | | | | parser.ts
103+
| | | | | latinToEnglish.ts
104+
| | | | | englishToLatin.ts
105+
| | | | |
106+
| | | | |───data
107+
| | | | | | uniques.ts
108+
| | | | | | stemList.ts
109+
| | | | | | inflects.ts
110+
| | | | | | english.ts
111+
| | | | | | dictLine.ts
112+
| | | | | | addons.ts
113+
| | | | | |
114+
| | | | | |───types
115+
| | | | | | | Characters.ts
116+
| | | | |
117+
| | | | |───utils
118+
| | | | | | tricks.ts
119+
| | | | | |
120+
| | | | | |───format
121+
| | | | | | | transVoice.ts
122+
| | | | | | | transTense.ts
123+
| | | | | | | transNumber.ts
124+
| | | | | | | transMood.ts
125+
| | | | | | | transGender.ts
126+
| | | | | | | transDeclensions.ts
127+
| | | | | | | formatter.ts
128+
| |
129+
| |───practice
130+
| | | [id].tsx
131+
|
132+
|───public
133+
| | question.svg
134+
| | plus.svg
135+
| | minus.svg
136+
| | github.svg
137+
| | flip.svg
138+
| | favicon.svg
139+
| | clear.svg
140+
| | arrowRight.svg
141+
| | arrowLeft.svg
142+
| | answer.svg
143+
|
144+
|───styles
145+
| | globals.css

0 commit comments

Comments
 (0)