26-1-20/1
This commit is contained in:
24
collect_code.py
Normal file
24
collect_code.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import os
|
||||
|
||||
# اسم الملف الناتج
|
||||
output_filename = "full_project_code_driver.txt"
|
||||
# المجلد الذي تريد سحب الكود منه
|
||||
source_folder = "./lib"
|
||||
|
||||
with open(output_filename, "w", encoding="utf-8") as outfile:
|
||||
for root, dirs, files in os.walk(source_folder):
|
||||
for file in files:
|
||||
if file.endswith(".dart"):
|
||||
file_path = os.path.join(root, file)
|
||||
# كتابة فاصل واسم الملف ليعرف الذكاء الاصطناعي أين يبدأ الملف
|
||||
outfile.write(f"\n\n{'='*50}\n")
|
||||
outfile.write(f"FILE PATH: {file_path}\n")
|
||||
outfile.write(f"{'='*50}\n\n")
|
||||
|
||||
try:
|
||||
with open(file_path, "r", encoding="utf-8") as infile:
|
||||
outfile.write(infile.read())
|
||||
except Exception as e:
|
||||
outfile.write(f"Error reading file: {e}\n")
|
||||
|
||||
print(f"تم تجميع الكود بنجاح في الملف: {output_filename}")
|
||||
Reference in New Issue
Block a user