auto-coder 0.1.361__py3-none-any.whl → 0.1.363__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of auto-coder might be problematic. Click here for more details.
- {auto_coder-0.1.361.dist-info → auto_coder-0.1.363.dist-info}/METADATA +2 -1
- {auto_coder-0.1.361.dist-info → auto_coder-0.1.363.dist-info}/RECORD +57 -29
- autocoder/agent/auto_learn.py +249 -262
- autocoder/agent/base_agentic/__init__.py +0 -0
- autocoder/agent/base_agentic/agent_hub.py +169 -0
- autocoder/agent/base_agentic/agentic_lang.py +112 -0
- autocoder/agent/base_agentic/agentic_tool_display.py +180 -0
- autocoder/agent/base_agentic/base_agent.py +1582 -0
- autocoder/agent/base_agentic/default_tools.py +683 -0
- autocoder/agent/base_agentic/test_base_agent.py +82 -0
- autocoder/agent/base_agentic/tool_registry.py +425 -0
- autocoder/agent/base_agentic/tools/__init__.py +12 -0
- autocoder/agent/base_agentic/tools/ask_followup_question_tool_resolver.py +72 -0
- autocoder/agent/base_agentic/tools/attempt_completion_tool_resolver.py +37 -0
- autocoder/agent/base_agentic/tools/base_tool_resolver.py +35 -0
- autocoder/agent/base_agentic/tools/example_tool_resolver.py +46 -0
- autocoder/agent/base_agentic/tools/execute_command_tool_resolver.py +72 -0
- autocoder/agent/base_agentic/tools/list_files_tool_resolver.py +110 -0
- autocoder/agent/base_agentic/tools/plan_mode_respond_tool_resolver.py +35 -0
- autocoder/agent/base_agentic/tools/read_file_tool_resolver.py +54 -0
- autocoder/agent/base_agentic/tools/replace_in_file_tool_resolver.py +156 -0
- autocoder/agent/base_agentic/tools/search_files_tool_resolver.py +134 -0
- autocoder/agent/base_agentic/tools/talk_to_group_tool_resolver.py +96 -0
- autocoder/agent/base_agentic/tools/talk_to_tool_resolver.py +79 -0
- autocoder/agent/base_agentic/tools/use_mcp_tool_resolver.py +44 -0
- autocoder/agent/base_agentic/tools/write_to_file_tool_resolver.py +58 -0
- autocoder/agent/base_agentic/types.py +189 -0
- autocoder/agent/base_agentic/utils.py +100 -0
- autocoder/auto_coder.py +1 -1
- autocoder/auto_coder_runner.py +36 -14
- autocoder/chat/conf_command.py +11 -10
- autocoder/commands/auto_command.py +227 -159
- autocoder/common/__init__.py +2 -2
- autocoder/common/ignorefiles/ignore_file_utils.py +12 -8
- autocoder/common/result_manager.py +10 -2
- autocoder/common/rulefiles/autocoderrules_utils.py +169 -0
- autocoder/common/save_formatted_log.py +1 -1
- autocoder/common/v2/agent/agentic_edit.py +53 -41
- autocoder/common/v2/agent/agentic_edit_tools/read_file_tool_resolver.py +15 -12
- autocoder/common/v2/agent/agentic_edit_tools/replace_in_file_tool_resolver.py +73 -1
- autocoder/common/v2/agent/agentic_edit_tools/write_to_file_tool_resolver.py +132 -4
- autocoder/common/v2/agent/agentic_edit_types.py +1 -2
- autocoder/common/v2/agent/agentic_tool_display.py +2 -3
- autocoder/common/v2/code_auto_generate_editblock.py +3 -1
- autocoder/index/index.py +14 -8
- autocoder/privacy/model_filter.py +297 -35
- autocoder/rag/long_context_rag.py +424 -397
- autocoder/rag/test_doc_filter.py +393 -0
- autocoder/rag/test_long_context_rag.py +473 -0
- autocoder/rag/test_token_limiter.py +342 -0
- autocoder/shadows/shadow_manager.py +1 -3
- autocoder/utils/_markitdown.py +22 -3
- autocoder/version.py +1 -1
- {auto_coder-0.1.361.dist-info → auto_coder-0.1.363.dist-info}/LICENSE +0 -0
- {auto_coder-0.1.361.dist-info → auto_coder-0.1.363.dist-info}/WHEEL +0 -0
- {auto_coder-0.1.361.dist-info → auto_coder-0.1.363.dist-info}/entry_points.txt +0 -0
- {auto_coder-0.1.361.dist-info → auto_coder-0.1.363.dist-info}/top_level.txt +0 -0
|
@@ -14,7 +14,9 @@ class ReplaceInFileToolResolver(BaseToolResolver):
|
|
|
14
14
|
def __init__(self, agent: Optional['AgenticEdit'], tool: ReplaceInFileTool, args: AutoCoderArgs):
|
|
15
15
|
super().__init__(agent, tool, args)
|
|
16
16
|
self.tool: ReplaceInFileTool = tool # For type hinting
|
|
17
|
+
self.args = args
|
|
17
18
|
self.shadow_manager = self.agent.shadow_manager if self.agent else None
|
|
19
|
+
self.shadow_linter = self.agent.shadow_linter if self.agent else None
|
|
18
20
|
|
|
19
21
|
def parse_diff(self, diff_content: str) -> List[Tuple[str, str]]:
|
|
20
22
|
"""
|
|
@@ -58,6 +60,30 @@ class ReplaceInFileToolResolver(BaseToolResolver):
|
|
|
58
60
|
logger.warning(f"Could not parse any SEARCH/REPLACE blocks from diff: {diff_content}")
|
|
59
61
|
return blocks
|
|
60
62
|
|
|
63
|
+
def _format_lint_issues(self, lint_result):
|
|
64
|
+
"""
|
|
65
|
+
将 lint 结果格式化为可读的文本格式
|
|
66
|
+
|
|
67
|
+
参数:
|
|
68
|
+
lint_result: 单个文件的 lint 结果对象
|
|
69
|
+
|
|
70
|
+
返回:
|
|
71
|
+
str: 格式化的问题描述
|
|
72
|
+
"""
|
|
73
|
+
formatted_issues = []
|
|
74
|
+
|
|
75
|
+
for issue in lint_result.issues:
|
|
76
|
+
severity = "错误" if issue.severity.value == 3 else "警告" if issue.severity.value == 2 else "信息"
|
|
77
|
+
line_info = f"第{issue.position.line}行"
|
|
78
|
+
if issue.position.column:
|
|
79
|
+
line_info += f", 第{issue.position.column}列"
|
|
80
|
+
|
|
81
|
+
formatted_issues.append(
|
|
82
|
+
f" - [{severity}] {line_info}: {issue.message} (规则: {issue.code})"
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
return "\n".join(formatted_issues)
|
|
86
|
+
|
|
61
87
|
def resolve(self) -> ToolResult:
|
|
62
88
|
file_path = self.tool.path
|
|
63
89
|
diff_content = self.tool.diff
|
|
@@ -130,6 +156,36 @@ class ReplaceInFileToolResolver(BaseToolResolver):
|
|
|
130
156
|
f.write(current_content)
|
|
131
157
|
logger.info(f"Successfully applied {applied_count}/{len(parsed_blocks)} changes to file: {file_path}")
|
|
132
158
|
|
|
159
|
+
# 新增:执行代码质量检查
|
|
160
|
+
lint_results = None
|
|
161
|
+
lint_message = ""
|
|
162
|
+
formatted_issues = ""
|
|
163
|
+
has_lint_issues = False
|
|
164
|
+
|
|
165
|
+
# 检查是否启用了Lint功能
|
|
166
|
+
enable_lint = self.args.enable_auto_fix_lint
|
|
167
|
+
|
|
168
|
+
if enable_lint:
|
|
169
|
+
try:
|
|
170
|
+
if self.shadow_linter and self.shadow_manager:
|
|
171
|
+
# 对修改后的文件进行 lint 检查
|
|
172
|
+
shadow_path = target_path # 已经是影子路径
|
|
173
|
+
lint_results = self.shadow_linter.lint_shadow_file(shadow_path)
|
|
174
|
+
|
|
175
|
+
if lint_results and lint_results.issues:
|
|
176
|
+
has_lint_issues = True
|
|
177
|
+
# 格式化 lint 问题
|
|
178
|
+
formatted_issues = self._format_lint_issues(lint_results)
|
|
179
|
+
lint_message = f"\n\n代码质量检查发现 {len(lint_results.issues)} 个问题:\n{formatted_issues}"
|
|
180
|
+
else:
|
|
181
|
+
lint_message = "\n\n代码质量检查通过,未发现问题。"
|
|
182
|
+
except Exception as e:
|
|
183
|
+
logger.error(f"Lint 检查失败: {str(e)}")
|
|
184
|
+
lint_message = "\n\n尝试进行代码质量检查时出错。"
|
|
185
|
+
else:
|
|
186
|
+
logger.info("代码质量检查已禁用")
|
|
187
|
+
|
|
188
|
+
# 构建包含 lint 结果的返回消息
|
|
133
189
|
if errors:
|
|
134
190
|
message = get_message_with_format("replace_in_file.apply_success_with_warnings",
|
|
135
191
|
applied=applied_count,
|
|
@@ -141,13 +197,29 @@ class ReplaceInFileToolResolver(BaseToolResolver):
|
|
|
141
197
|
applied=applied_count,
|
|
142
198
|
total=len(parsed_blocks),
|
|
143
199
|
file_path=file_path)
|
|
200
|
+
|
|
201
|
+
# 将 lint 消息添加到结果中,如果启用了Lint
|
|
202
|
+
if enable_lint:
|
|
203
|
+
message += lint_message
|
|
144
204
|
|
|
145
205
|
# 变更跟踪,回调AgenticEdit
|
|
146
206
|
if self.agent:
|
|
147
207
|
rel_path = os.path.relpath(abs_file_path, abs_project_dir)
|
|
148
208
|
self.agent.record_file_change(rel_path, "modified", diff=diff_content, content=current_content)
|
|
149
209
|
|
|
150
|
-
|
|
210
|
+
# 附加 lint 结果到返回内容
|
|
211
|
+
result_content = {
|
|
212
|
+
"content": current_content,
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
# 只有在启用Lint时才添加Lint结果
|
|
216
|
+
if enable_lint:
|
|
217
|
+
result_content["lint_results"] = {
|
|
218
|
+
"has_issues": has_lint_issues,
|
|
219
|
+
"issues": formatted_issues if has_lint_issues else None
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return ToolResult(success=True, message=message, content=result_content)
|
|
151
223
|
except Exception as e:
|
|
152
224
|
logger.error(f"Error writing replaced content to file '{file_path}': {str(e)}")
|
|
153
225
|
return ToolResult(success=False, message=get_message_with_format("replace_in_file.write_error", error=str(e)))
|
|
@@ -4,6 +4,7 @@ from autocoder.common.v2.agent.agentic_edit_types import WriteToFileTool, ToolRe
|
|
|
4
4
|
from autocoder.common.v2.agent.agentic_edit_tools.base_tool_resolver import BaseToolResolver
|
|
5
5
|
from loguru import logger
|
|
6
6
|
from autocoder.common import AutoCoderArgs
|
|
7
|
+
from autocoder.common.auto_coder_lang import get_message_with_format
|
|
7
8
|
import typing
|
|
8
9
|
|
|
9
10
|
if typing.TYPE_CHECKING:
|
|
@@ -13,7 +14,33 @@ class WriteToFileToolResolver(BaseToolResolver):
|
|
|
13
14
|
def __init__(self, agent: Optional['AgenticEdit'], tool: WriteToFileTool, args: AutoCoderArgs):
|
|
14
15
|
super().__init__(agent, tool, args)
|
|
15
16
|
self.tool: WriteToFileTool = tool # For type hinting
|
|
17
|
+
self.args = args
|
|
16
18
|
self.shadow_manager = self.agent.shadow_manager if self.agent else None
|
|
19
|
+
self.shadow_linter = self.agent.shadow_linter if self.agent else None
|
|
20
|
+
|
|
21
|
+
def _format_lint_issues(self, lint_result):
|
|
22
|
+
"""
|
|
23
|
+
将 lint 结果格式化为可读的文本格式
|
|
24
|
+
|
|
25
|
+
参数:
|
|
26
|
+
lint_result: 单个文件的 lint 结果对象
|
|
27
|
+
|
|
28
|
+
返回:
|
|
29
|
+
str: 格式化的问题描述
|
|
30
|
+
"""
|
|
31
|
+
formatted_issues = []
|
|
32
|
+
|
|
33
|
+
for issue in lint_result.issues:
|
|
34
|
+
severity = "错误" if issue.severity.value == 3 else "警告" if issue.severity.value == 2 else "信息"
|
|
35
|
+
line_info = f"第{issue.position.line}行"
|
|
36
|
+
if issue.position.column:
|
|
37
|
+
line_info += f", 第{issue.position.column}列"
|
|
38
|
+
|
|
39
|
+
formatted_issues.append(
|
|
40
|
+
f" - [{severity}] {line_info}: {issue.message} (规则: {issue.code})"
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
return "\n".join(formatted_issues)
|
|
17
44
|
|
|
18
45
|
def resolve(self) -> ToolResult:
|
|
19
46
|
file_path = self.tool.path
|
|
@@ -39,8 +66,56 @@ class WriteToFileToolResolver(BaseToolResolver):
|
|
|
39
66
|
if self.agent:
|
|
40
67
|
rel_path = os.path.relpath(abs_file_path, abs_project_dir)
|
|
41
68
|
self.agent.record_file_change(rel_path, "added", diff=None, content=content)
|
|
42
|
-
|
|
43
|
-
|
|
69
|
+
|
|
70
|
+
# 新增:执行代码质量检查
|
|
71
|
+
lint_results = None
|
|
72
|
+
lint_message = ""
|
|
73
|
+
formatted_issues = ""
|
|
74
|
+
has_lint_issues = False
|
|
75
|
+
|
|
76
|
+
# 检查是否启用了Lint功能
|
|
77
|
+
enable_lint = self.args.enable_auto_fix_lint
|
|
78
|
+
|
|
79
|
+
if enable_lint:
|
|
80
|
+
try:
|
|
81
|
+
if self.shadow_linter and self.shadow_manager:
|
|
82
|
+
# 对新创建的文件进行 lint 检查
|
|
83
|
+
shadow_path = self.shadow_manager.to_shadow_path(abs_file_path)
|
|
84
|
+
lint_results = self.shadow_linter.lint_shadow_file(shadow_path)
|
|
85
|
+
|
|
86
|
+
if lint_results and lint_results.issues:
|
|
87
|
+
has_lint_issues = True
|
|
88
|
+
# 格式化 lint 问题
|
|
89
|
+
formatted_issues = self._format_lint_issues(lint_results)
|
|
90
|
+
lint_message = f"\n\n代码质量检查发现 {len(lint_results.issues)} 个问题:\n{formatted_issues}"
|
|
91
|
+
else:
|
|
92
|
+
lint_message = "\n\n代码质量检查通过,未发现问题。"
|
|
93
|
+
except Exception as e:
|
|
94
|
+
logger.error(f"Lint 检查失败: {str(e)}")
|
|
95
|
+
lint_message = "\n\n尝试进行代码质量检查时出错。"
|
|
96
|
+
else:
|
|
97
|
+
logger.info("代码质量检查已禁用")
|
|
98
|
+
|
|
99
|
+
# 构建包含 lint 结果的返回消息
|
|
100
|
+
message = f"Successfully wrote to file (shadow): {file_path}"
|
|
101
|
+
|
|
102
|
+
# 将 lint 消息添加到结果中,如果启用了Lint
|
|
103
|
+
if enable_lint:
|
|
104
|
+
message += lint_message
|
|
105
|
+
|
|
106
|
+
# 附加 lint 结果到返回内容
|
|
107
|
+
result_content = {
|
|
108
|
+
"content": content,
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
# 只有在启用Lint时才添加Lint结果
|
|
112
|
+
if enable_lint:
|
|
113
|
+
result_content["lint_results"] = {
|
|
114
|
+
"has_issues": has_lint_issues,
|
|
115
|
+
"issues": formatted_issues if has_lint_issues else None
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return ToolResult(success=True, message=message, content=result_content)
|
|
44
119
|
else:
|
|
45
120
|
# No shadow manager fallback to original file
|
|
46
121
|
os.makedirs(os.path.dirname(abs_file_path), exist_ok=True)
|
|
@@ -51,8 +126,61 @@ class WriteToFileToolResolver(BaseToolResolver):
|
|
|
51
126
|
if self.agent:
|
|
52
127
|
rel_path = os.path.relpath(abs_file_path, abs_project_dir)
|
|
53
128
|
self.agent.record_file_change(rel_path, "added", diff=None, content=content)
|
|
54
|
-
|
|
55
|
-
|
|
129
|
+
|
|
130
|
+
# 新增:执行代码质量检查
|
|
131
|
+
lint_results = None
|
|
132
|
+
lint_message = ""
|
|
133
|
+
formatted_issues = ""
|
|
134
|
+
has_lint_issues = False
|
|
135
|
+
|
|
136
|
+
# 检查是否启用了Lint功能
|
|
137
|
+
enable_lint = self.args.enable_auto_fix_lint
|
|
138
|
+
|
|
139
|
+
if enable_lint:
|
|
140
|
+
try:
|
|
141
|
+
if self.shadow_linter and self.shadow_manager:
|
|
142
|
+
# 对新创建的文件进行 lint 检查
|
|
143
|
+
# 由于没有shadow系统,需要先创建shadow文件
|
|
144
|
+
shadow_path = self.shadow_manager.to_shadow_path(abs_file_path)
|
|
145
|
+
os.makedirs(os.path.dirname(shadow_path), exist_ok=True)
|
|
146
|
+
with open(shadow_path, 'w', encoding='utf-8') as f:
|
|
147
|
+
f.write(content)
|
|
148
|
+
|
|
149
|
+
lint_results = self.shadow_linter.lint_shadow_file(shadow_path)
|
|
150
|
+
|
|
151
|
+
if lint_results and lint_results.issues:
|
|
152
|
+
has_lint_issues = True
|
|
153
|
+
# 格式化 lint 问题
|
|
154
|
+
formatted_issues = self._format_lint_issues(lint_results)
|
|
155
|
+
lint_message = f"\n\n代码质量检查发现 {len(lint_results.issues)} 个问题:\n{formatted_issues}"
|
|
156
|
+
else:
|
|
157
|
+
lint_message = "\n\n代码质量检查通过,未发现问题。"
|
|
158
|
+
except Exception as e:
|
|
159
|
+
logger.error(f"Lint 检查失败: {str(e)}")
|
|
160
|
+
lint_message = "\n\n尝试进行代码质量检查时出错。"
|
|
161
|
+
else:
|
|
162
|
+
logger.info("代码质量检查已禁用")
|
|
163
|
+
|
|
164
|
+
# 构建包含 lint 结果的返回消息
|
|
165
|
+
message = f"Successfully wrote to file: {file_path}"
|
|
166
|
+
|
|
167
|
+
# 将 lint 消息添加到结果中,如果启用了Lint
|
|
168
|
+
if enable_lint:
|
|
169
|
+
message += lint_message
|
|
170
|
+
|
|
171
|
+
# 附加 lint 结果到返回内容
|
|
172
|
+
result_content = {
|
|
173
|
+
"content": content,
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
# 只有在启用Lint时才添加Lint结果
|
|
177
|
+
if enable_lint:
|
|
178
|
+
result_content["lint_results"] = {
|
|
179
|
+
"has_issues": has_lint_issues,
|
|
180
|
+
"issues": formatted_issues if has_lint_issues else None
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return ToolResult(success=True, message=message, content=result_content)
|
|
56
184
|
except Exception as e:
|
|
57
185
|
logger.error(f"Error writing to file '{file_path}': {str(e)}")
|
|
58
186
|
return ToolResult(success=False, message=f"An error occurred while writing to the file: {str(e)}")
|
|
@@ -2,7 +2,6 @@ from pydantic import BaseModel
|
|
|
2
2
|
from typing import List, Dict, Any, Callable, Optional, Type
|
|
3
3
|
from pydantic import SkipValidation
|
|
4
4
|
|
|
5
|
-
|
|
6
5
|
# Result class used by Tool Resolvers
|
|
7
6
|
class ToolResult(BaseModel):
|
|
8
7
|
success: bool
|
|
@@ -115,7 +114,7 @@ TOOL_MODEL_MAP: Dict[str, Type[BaseTool]] = {
|
|
|
115
114
|
"attempt_completion": AttemptCompletionTool,
|
|
116
115
|
"plan_mode_respond": PlanModeRespondTool,
|
|
117
116
|
"use_mcp_tool": UseMcpTool,
|
|
118
|
-
"list_package_info": ListPackageInfoTool,
|
|
117
|
+
"list_package_info": ListPackageInfoTool,
|
|
119
118
|
}
|
|
120
119
|
|
|
121
120
|
class FileChangeEntry(BaseModel):
|
|
@@ -93,8 +93,7 @@ TOOL_DISPLAY_MESSAGES: Dict[Type[BaseTool], Dict[str, str]] = {
|
|
|
93
93
|
"[dim]工具:[/dim] [blue]{{ tool_name }}[/]\n"
|
|
94
94
|
"[dim]参数:[/dim] {{ arguments_snippet }}{{ ellipsis }}"
|
|
95
95
|
)
|
|
96
|
-
}
|
|
97
|
-
# AttemptCompletionTool is handled separately in the display loop
|
|
96
|
+
}
|
|
98
97
|
}
|
|
99
98
|
|
|
100
99
|
def get_tool_display_message(tool: BaseTool) -> str:
|
|
@@ -172,7 +171,7 @@ def get_tool_display_message(tool: BaseTool) -> str:
|
|
|
172
171
|
"tool_name": tool.tool_name,
|
|
173
172
|
"arguments_snippet": snippet,
|
|
174
173
|
"ellipsis": '...' if len(args_str) > 100 else ''
|
|
175
|
-
}
|
|
174
|
+
}
|
|
176
175
|
else:
|
|
177
176
|
# Generic context for tools not specifically handled above
|
|
178
177
|
context = tool.model_dump()
|
autocoder/index/index.py
CHANGED
|
@@ -31,6 +31,7 @@ from autocoder.rag.token_counter import count_tokens
|
|
|
31
31
|
from autocoder.common.stream_out_type import IndexStreamOutType
|
|
32
32
|
from autocoder.events.event_manager_singleton import get_event_manager
|
|
33
33
|
from autocoder.events import event_content as EventContentCreator
|
|
34
|
+
from loguru import logger
|
|
34
35
|
|
|
35
36
|
class IndexManager:
|
|
36
37
|
def __init__(
|
|
@@ -220,7 +221,7 @@ class IndexManager:
|
|
|
220
221
|
5. 导入语句中需要包含 jsp:include 整个标签,类似 <jsp:include page="/jspf/prelude.jspf" />
|
|
221
222
|
6. 导入语句中需要包含 form 标签,类似 <form name="ActionPlanLinkedForm" action="/ri/ActionPlanController.do" method="post">
|
|
222
223
|
7. 导入语句中需要包含 有 src 属性的 script 标签。比如 <script language="script" src="xxx">
|
|
223
|
-
8. 导入语句中需要包含 有 src 属性的 link 标签。 比如 <link
|
|
224
|
+
8. 导入语句中需要包含 有 src 属性的 link 标签。 比如 <link rel="stylesheet" type="text/css" href="/ri/ui/styles/xptheme.css">
|
|
224
225
|
9. 导入语句中需要包含 ajax 请求里的url,比如 $.ajax({
|
|
225
226
|
type : "post",
|
|
226
227
|
url : "admWorkingDay!updateAdmWorkingDayList.action", 中,那么对应的为 <ajax method="post" url="admWorkingDay!updateAdmWorkingDayList.action">
|
|
@@ -656,13 +657,18 @@ class IndexManager:
|
|
|
656
657
|
|
|
657
658
|
index_items = []
|
|
658
659
|
for module_name, data in index_data.items():
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
660
|
+
try:
|
|
661
|
+
index_item = IndexItem(
|
|
662
|
+
module_name=module_name,
|
|
663
|
+
symbols=data["symbols"],
|
|
664
|
+
last_modified=data["last_modified"],
|
|
665
|
+
md5=data["md5"],
|
|
666
|
+
)
|
|
667
|
+
index_items.append(index_item)
|
|
668
|
+
except (KeyError, TypeError) as e:
|
|
669
|
+
logger.warning(f"处理索引条目 {module_name} 时出错: {str(e)}")
|
|
670
|
+
logger.exception(e)
|
|
671
|
+
continue
|
|
666
672
|
|
|
667
673
|
return index_items
|
|
668
674
|
|