Update app.py
Browse files
app.py
CHANGED
@@ -662,11 +662,13 @@ def project_view_page():
|
|
662 |
project_folder = os.path.join(user_folder, st.session_state.current_project)
|
663 |
|
664 |
# Count number of files
|
665 |
-
num_files = sum([len(files) for _, _, files in os.walk(project_folder)])
|
666 |
|
667 |
# Count total lines of code in all text files
|
668 |
num_lines = 0
|
669 |
for root, _, files in os.walk(project_folder):
|
|
|
|
|
670 |
for file in files:
|
671 |
file_path = os.path.join(root, file)
|
672 |
try:
|
@@ -704,6 +706,8 @@ def project_view_page():
|
|
704 |
if st.session_state.show_file_structure:
|
705 |
st.write("File structure:")
|
706 |
for root, dirs, files in os.walk(project_folder):
|
|
|
|
|
707 |
level = root.replace(project_folder, "").count(os.sep)
|
708 |
indent = " " * 4 * level
|
709 |
|
|
|
662 |
project_folder = os.path.join(user_folder, st.session_state.current_project)
|
663 |
|
664 |
# Count number of files
|
665 |
+
num_files = sum([len(files) for _, _, files in os.walk(project_folder) if ".git" not in _])
|
666 |
|
667 |
# Count total lines of code in all text files
|
668 |
num_lines = 0
|
669 |
for root, _, files in os.walk(project_folder):
|
670 |
+
if ".git" in root:
|
671 |
+
continue # Skip .git directory
|
672 |
for file in files:
|
673 |
file_path = os.path.join(root, file)
|
674 |
try:
|
|
|
706 |
if st.session_state.show_file_structure:
|
707 |
st.write("File structure:")
|
708 |
for root, dirs, files in os.walk(project_folder):
|
709 |
+
if ".git" in root:
|
710 |
+
continue # Skip .git directory
|
711 |
level = root.replace(project_folder, "").count(os.sep)
|
712 |
indent = " " * 4 * level
|
713 |
|