qingxu99 commited on
Commit
eda3c6d
1 Parent(s): effa142
crazy_functions/解析项目源代码.py CHANGED
@@ -119,8 +119,8 @@ def 解析一个C项目的头文件(txt, top_p, temperature, chatbot, history, s
119
  report_execption(chatbot, history, a = f"解析项目: {txt}", b = f"找不到本地项目或无权访问: {txt}")
120
  yield chatbot, history, '正常'
121
  return
122
- file_manifest = [f for f in glob.glob(f'{project_folder}/**/*.h', recursive=True)] # + \
123
- # [f for f in glob.glob(f'{project_folder}/**/*.cpp', recursive=True)] + \
124
  # [f for f in glob.glob(f'{project_folder}/**/*.c', recursive=True)]
125
  if len(file_manifest) == 0:
126
  report_execption(chatbot, history, a = f"解析项目: {txt}", b = f"找不到任何.h头文件: {txt}")
@@ -141,6 +141,7 @@ def 解析一个C项目(txt, top_p, temperature, chatbot, history, systemPromptT
141
  return
142
  file_manifest = [f for f in glob.glob(f'{project_folder}/**/*.h', recursive=True)] + \
143
  [f for f in glob.glob(f'{project_folder}/**/*.cpp', recursive=True)] + \
 
144
  [f for f in glob.glob(f'{project_folder}/**/*.c', recursive=True)]
145
  if len(file_manifest) == 0:
146
  report_execption(chatbot, history, a = f"解析项目: {txt}", b = f"找不到任何.h头文件: {txt}")
 
119
  report_execption(chatbot, history, a = f"解析项目: {txt}", b = f"找不到本地项目或无权访问: {txt}")
120
  yield chatbot, history, '正常'
121
  return
122
+ file_manifest = [f for f in glob.glob(f'{project_folder}/**/*.h', recursive=True)] + \
123
+ [f for f in glob.glob(f'{project_folder}/**/*.hpp', recursive=True)] #+ \
124
  # [f for f in glob.glob(f'{project_folder}/**/*.c', recursive=True)]
125
  if len(file_manifest) == 0:
126
  report_execption(chatbot, history, a = f"解析项目: {txt}", b = f"找不到任何.h头文件: {txt}")
 
141
  return
142
  file_manifest = [f for f in glob.glob(f'{project_folder}/**/*.h', recursive=True)] + \
143
  [f for f in glob.glob(f'{project_folder}/**/*.cpp', recursive=True)] + \
144
+ [f for f in glob.glob(f'{project_folder}/**/*.hpp', recursive=True)] + \
145
  [f for f in glob.glob(f'{project_folder}/**/*.c', recursive=True)]
146
  if len(file_manifest) == 0:
147
  report_execption(chatbot, history, a = f"解析项目: {txt}", b = f"找不到任何.h头文件: {txt}")
toolbox.py CHANGED
@@ -303,7 +303,9 @@ def on_file_uploaded(files, chatbot, txt):
303
  def on_report_generated(files, chatbot):
304
  from toolbox import find_recent_files
305
  report_files = find_recent_files('gpt_log')
306
- if len(report_files) == 0: return files, chatbot
 
 
307
  # files.extend(report_files)
308
  chatbot.append(['汇总报告如何远程获取?', '汇总报告已经添加到右侧“文件上传区”(可能处于折叠状态),请查收。'])
309
  return report_files, chatbot
 
303
  def on_report_generated(files, chatbot):
304
  from toolbox import find_recent_files
305
  report_files = find_recent_files('gpt_log')
306
+ if len(report_files) == 0:
307
+ if files is None: return None, chatbot
308
+ else: return [], chatbot
309
  # files.extend(report_files)
310
  chatbot.append(['汇总报告如何远程获取?', '汇总报告已经添加到右侧“文件上传区”(可能处于折叠状态),请查收。'])
311
  return report_files, chatbot