add: terminal tool
This commit is contained in:
37
summerizer
Executable file
37
summerizer
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/python3
|
||||
import os
|
||||
|
||||
ignores = [
|
||||
'bin',
|
||||
'obj',
|
||||
'.godot',
|
||||
'.idea',
|
||||
'icon.svg',
|
||||
'icon.svg.import',
|
||||
"Resources",
|
||||
"GiteaApiClient.cs"
|
||||
]
|
||||
def find_all_proj_files(base_path):
|
||||
res = []
|
||||
for root, dirs, files in os.walk(base_path):
|
||||
dirs[:] = [d for d in dirs if not d.startswith('.') and not d in ignores]
|
||||
for file in files:
|
||||
if file not in ignores:
|
||||
res.append(os.path.join(root, file))
|
||||
return res
|
||||
|
||||
|
||||
def summerizer():
|
||||
current_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
fs = find_all_proj_files(current_dir)
|
||||
res = ""
|
||||
for file in fs:
|
||||
with open(file) as f:
|
||||
res += f"---------------------{file}-------------------------\n"
|
||||
res += f.read()
|
||||
res += "\n"
|
||||
print(res)
|
||||
|
||||
summerizer()
|
||||
Reference in New Issue
Block a user