Update app.py
Browse files
app.py
CHANGED
|
@@ -73,28 +73,28 @@ global_shown_pairs_cache = {}
|
|
| 73 |
global_history_has_unsaved_changes = False
|
| 74 |
|
| 75 |
print(f"调试:检查 '{base_path}' (CWD) 的内容:")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
try:
|
| 77 |
-
for item in os.listdir(
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
print(f"
|
| 81 |
except Exception as e:
|
| 82 |
-
print(f"
|
| 83 |
-
|
| 84 |
-
print(f"
|
| 85 |
-
|
| 86 |
-
print(f" 确认:'{full_subdir_path}' 存在并且是一个目录。")
|
| 87 |
-
print(f" 调试:'{full_subdir_path}' 的内容:")
|
| 88 |
-
try:
|
| 89 |
-
for item in os.listdir(full_subdir_path):
|
| 90 |
-
item_path_in_subdir = os.path.join(full_subdir_path, item)
|
| 91 |
-
item_type_in_subdir = "DIR" if os.path.isdir(item_path_in_subdir) else "FILE"
|
| 92 |
-
print(f" - Subdir Item: {item} ({item_type_in_subdir})")
|
| 93 |
-
except Exception as e:
|
| 94 |
-
print(f" 错误:列出子目录 '{full_subdir_path}' 内容失败: {e}")
|
| 95 |
-
else:
|
| 96 |
-
print(f" 警告:'{full_subdir_path}' 不存在或不是一个目录 (检查结果)。")
|
| 97 |
-
|
| 98 |
def load_global_shown_pairs():
|
| 99 |
global global_shown_pairs_cache, global_history_has_unsaved_changes
|
| 100 |
if os.path.exists(GLOBAL_HISTORY_FILE):
|
|
|
|
| 73 |
global_history_has_unsaved_changes = False
|
| 74 |
|
| 75 |
print(f"调试:检查 '{base_path}' (CWD) 的内容:")
|
| 76 |
+
try:
|
| 77 |
+
for item in os.listdir(base_path):
|
| 78 |
+
item_path_full = os.path.join(base_path, item)
|
| 79 |
+
item_type = "DIR" if os.path.isdir(item_path_full) else "FILE"
|
| 80 |
+
print(f" - CWD Item: {item} ({item_type})")
|
| 81 |
+
except Exception as e:
|
| 82 |
+
print(f" 错误:列出CWD '{base_path}' 内容失败: {e}")
|
| 83 |
+
|
| 84 |
+
print(f"调试:检查子目录 '{full_subdir_path}' 是否真的存在且为目录...")
|
| 85 |
+
if os.path.exists(full_subdir_path) and os.path.isdir(full_subdir_path):
|
| 86 |
+
print(f" 确认:'{full_subdir_path}' 存在并且是一个目录。")
|
| 87 |
+
print(f" 调试:'{full_subdir_path}' 的内容:")
|
| 88 |
try:
|
| 89 |
+
for item in os.listdir(full_subdir_path):
|
| 90 |
+
item_path_in_subdir = os.path.join(full_subdir_path, item)
|
| 91 |
+
item_type_in_subdir = "DIR" if os.path.isdir(item_path_in_subdir) else "FILE"
|
| 92 |
+
print(f" - Subdir Item: {item} ({item_type_in_subdir})")
|
| 93 |
except Exception as e:
|
| 94 |
+
print(f" 错误:列出子目录 '{full_subdir_path}' 内容失败: {e}")
|
| 95 |
+
else:
|
| 96 |
+
print(f" 警告:'{full_subdir_path}' 不存在或不是一个目录 (检查结果)。")
|
| 97 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
def load_global_shown_pairs():
|
| 99 |
global global_shown_pairs_cache, global_history_has_unsaved_changes
|
| 100 |
if os.path.exists(GLOBAL_HISTORY_FILE):
|