Spaces:
Runtime error
Runtime error
mrhblfx
commited on
Commit
•
0ff8384
1
Parent(s):
cfbfb68
fix a bug
Browse files
crazy_functions/解析项目源代码.py
CHANGED
@@ -296,8 +296,9 @@ def 解析任意code项目(txt, llm_kwargs, plugin_kwargs, chatbot, history, sys
|
|
296 |
extract_folder_path = maybe_dir[0].replace('\\', '/') if len(maybe_dir) != 0 else ""
|
297 |
# 按输入的匹配模式寻找上传的非压缩文件和已解压的文件
|
298 |
file_manifest = [f for f in glob.glob(f'{project_folder}/**') if os.path.isfile(f) and not re.search(pattern_except, f)] + \
|
299 |
-
[f for _ in pattern_include for f in glob.glob(f'{extract_folder_path}/**/{_}', recursive=True) if \
|
300 |
-
|
|
|
301 |
if len(file_manifest) == 0:
|
302 |
report_execption(chatbot, history, a = f"解析项目: {txt}", b = f"找不到任何文件: {txt}")
|
303 |
yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
|
|
|
296 |
extract_folder_path = maybe_dir[0].replace('\\', '/') if len(maybe_dir) != 0 else ""
|
297 |
# 按输入的匹配模式寻找上传的非压缩文件和已解压的文件
|
298 |
file_manifest = [f for f in glob.glob(f'{project_folder}/**') if os.path.isfile(f) and not re.search(pattern_except, f)] + \
|
299 |
+
[f for _ in pattern_include for f in glob.glob(f'{extract_folder_path}/**/{_}', recursive=True) if "" != extract_folder_path and \
|
300 |
+
os.path.isfile(f) and (not re.search(pattern_except, f) or _.endswith('.' + re.search(pattern_except, f).group().split('.')[-1]))]
|
301 |
+
|
302 |
if len(file_manifest) == 0:
|
303 |
report_execption(chatbot, history, a = f"解析项目: {txt}", b = f"找不到任何文件: {txt}")
|
304 |
yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
|