Spaces:
Paused
Paused
RongkangXiong
commited on
Commit
·
55ef4ac
1
Parent(s):
8e0f401
add crazy_functions 解析一个Java项目
Browse files- crazy_functions/解析项目源代码.py +22 -0
- functional_crazy.py +6 -0
crazy_functions/解析项目源代码.py
CHANGED
|
@@ -148,6 +148,28 @@ def 解析一个C项目(txt, top_p, temperature, chatbot, history, systemPromptT
|
|
| 148 |
return
|
| 149 |
yield from 解析源代码(file_manifest, project_folder, top_p, temperature, chatbot, history, systemPromptTxt)
|
| 150 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 151 |
@CatchException
|
| 152 |
def 解析一个Golang项目(txt, top_p, temperature, chatbot, history, systemPromptTxt, WEB_PORT):
|
| 153 |
history = [] # 清空历史,以免输入溢出
|
|
|
|
| 148 |
return
|
| 149 |
yield from 解析源代码(file_manifest, project_folder, top_p, temperature, chatbot, history, systemPromptTxt)
|
| 150 |
|
| 151 |
+
|
| 152 |
+
@CatchException
|
| 153 |
+
def 解析一个Java项目(txt, top_p, temperature, chatbot, history, systemPromptTxt, WEB_PORT):
|
| 154 |
+
history = [] # 清空历史,以免输入溢出
|
| 155 |
+
import glob, os
|
| 156 |
+
if os.path.exists(txt):
|
| 157 |
+
project_folder = txt
|
| 158 |
+
else:
|
| 159 |
+
if txt == "": txt = '空空如也的输入栏'
|
| 160 |
+
report_execption(chatbot, history, a = f"解析项目: {txt}", b = f"找不到本地项目或无权访问: {txt}")
|
| 161 |
+
yield chatbot, history, '正常'
|
| 162 |
+
return
|
| 163 |
+
file_manifest = [f for f in glob.glob(f'{project_folder}/**/*.java', recursive=True)] + \
|
| 164 |
+
[f for f in glob.glob(f'{project_folder}/**/*.jar', recursive=True)] + \
|
| 165 |
+
[f for f in glob.glob(f'{project_folder}/**/*.xml', recursive=True)] + \
|
| 166 |
+
[f for f in glob.glob(f'{project_folder}/**/*.sh', recursive=True)]
|
| 167 |
+
if len(file_manifest) == 0:
|
| 168 |
+
report_execption(chatbot, history, a = f"解析项目: {txt}", b = f"找不到任何java头文件: {txt}")
|
| 169 |
+
yield chatbot, history, '正常'
|
| 170 |
+
return
|
| 171 |
+
yield from 解析源代码(file_manifest, project_folder, top_p, temperature, chatbot, history, systemPromptTxt)
|
| 172 |
+
|
| 173 |
@CatchException
|
| 174 |
def 解析一个Golang项目(txt, top_p, temperature, chatbot, history, systemPromptTxt, WEB_PORT):
|
| 175 |
history = [] # 清空历史,以免输入溢出
|
functional_crazy.py
CHANGED
|
@@ -15,6 +15,7 @@ def get_crazy_functionals():
|
|
| 15 |
from crazy_functions.解析项目源代码 import 解析一个C项目的头文件
|
| 16 |
from crazy_functions.解析项目源代码 import 解析一个C项目
|
| 17 |
from crazy_functions.解析项目源代码 import 解析一个Golang项目
|
|
|
|
| 18 |
from crazy_functions.高级功能函数模板 import 高阶功能模板函数
|
| 19 |
from crazy_functions.代码重写为全英文_多线程 import 全项目切换英文
|
| 20 |
|
|
@@ -41,6 +42,11 @@ def get_crazy_functionals():
|
|
| 41 |
"AsButton": False, # 加入下拉菜单中
|
| 42 |
"Function": 解析一个Golang项目
|
| 43 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
"读Tex论文写摘要": {
|
| 45 |
"Color": "stop", # 按钮颜色
|
| 46 |
"Function": 读文章写摘要
|
|
|
|
| 15 |
from crazy_functions.解析项目源代码 import 解析一个C项目的头文件
|
| 16 |
from crazy_functions.解析项目源代码 import 解析一个C项目
|
| 17 |
from crazy_functions.解析项目源代码 import 解析一个Golang项目
|
| 18 |
+
from crazy_functions.解析项目源代码 import 解析一个Java项目
|
| 19 |
from crazy_functions.高级功能函数模板 import 高阶功能模板函数
|
| 20 |
from crazy_functions.代码重写为全英文_多线程 import 全项目切换英文
|
| 21 |
|
|
|
|
| 42 |
"AsButton": False, # 加入下拉菜单中
|
| 43 |
"Function": 解析一个Golang项目
|
| 44 |
},
|
| 45 |
+
"解析整个Java项目": {
|
| 46 |
+
"Color": "stop", # 按钮颜色
|
| 47 |
+
"AsButton": False, # 加入下拉菜单中
|
| 48 |
+
"Function": 解析一个Java项目
|
| 49 |
+
},
|
| 50 |
"读Tex论文写摘要": {
|
| 51 |
"Color": "stop", # 按钮颜色
|
| 52 |
"Function": 读文章写摘要
|