beswarm 0.1.56__py3-none-any.whl → 0.1.57__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.
- beswarm/tools/edit_file.py +21 -1
- {beswarm-0.1.56.dist-info → beswarm-0.1.57.dist-info}/METADATA +1 -1
- {beswarm-0.1.56.dist-info → beswarm-0.1.57.dist-info}/RECORD +5 -5
- {beswarm-0.1.56.dist-info → beswarm-0.1.57.dist-info}/WHEEL +0 -0
- {beswarm-0.1.56.dist-info → beswarm-0.1.57.dist-info}/top_level.txt +0 -0
beswarm/tools/edit_file.py
CHANGED
@@ -157,4 +157,24 @@ def edit_file(file_path, diff_content, match_precision=0.8):
|
|
157
157
|
except UnicodeDecodeError:
|
158
158
|
return f"错误: 文件 '{file_path}' 不是文本文件或编码不是UTF-8,无法进行编码解析"
|
159
159
|
except Exception as e:
|
160
|
-
|
160
|
+
print(f"content: {content}")
|
161
|
+
print(f"file_path: {file_path}")
|
162
|
+
print(f"diff_content: {diff_content}")
|
163
|
+
import traceback
|
164
|
+
traceback.print_exc()
|
165
|
+
return f"编辑文件时发生错误: {e}"
|
166
|
+
|
167
|
+
if __name__ == "__main__":
|
168
|
+
edit_str = """
|
169
|
+
<<<<<<< SEARCH
|
170
|
+
parser.add_argument('--dataset', type=str, default='cifar10', choices=['cifar10', 'cifar100', 'imagenet'], help="Dataset to use.")
|
171
|
+
=======
|
172
|
+
parser.add_argument('--dataset', type=str, default='cifar10', choices=['cifar10', 'cifar100', 'imagenet', 'tinyimagenet'], help="Dataset to use.")
|
173
|
+
>>>>>>> REPLACE
|
174
|
+
"""
|
175
|
+
|
176
|
+
file_path = "train.py"
|
177
|
+
# 编辑文件时发生错误: '>' not supported between instances of 'str' and 'float'
|
178
|
+
print(edit_file(file_path, edit_str))
|
179
|
+
|
180
|
+
# python -m beswarm.tools.edit_file
|
@@ -122,14 +122,14 @@ beswarm/queries/tree-sitter-languages/typescript-tags.scm,sha256=OMdCeedPiA24ky8
|
|
122
122
|
beswarm/tools/UIworker.py,sha256=1sEC76VGFwo48lSx6KOvhJwhgBj7UWAHAAH9BG_lp-M,6439
|
123
123
|
beswarm/tools/__init__.py,sha256=jOfYY4EYkwmz-FTJGrI1CyaIYkGWsmGzZBGsoupeX9M,1088
|
124
124
|
beswarm/tools/click.py,sha256=TygaekCXTmU3fIu6Uom7ZcyzEgYMlCC_GX-5SmWHuLI,20762
|
125
|
-
beswarm/tools/edit_file.py,sha256=
|
125
|
+
beswarm/tools/edit_file.py,sha256=xlAD0HB_xM0yZYc0eJwLE-9mAkywXa2UQPNHzG1OaW4,7664
|
126
126
|
beswarm/tools/planner.py,sha256=lguBCS6kpwNPoXQvqH-WySabVubT82iyWOkJnjt6dXw,1265
|
127
127
|
beswarm/tools/repomap.py,sha256=CwvwoN5Swr42EzrORTTeV8MMb7mPviy4a4b0fxBu50k,40828
|
128
128
|
beswarm/tools/search_arxiv.py,sha256=9slwBemXjEqrd7-YgVmyMijPXlkhZCybEDRVhWVQ9B0,7937
|
129
129
|
beswarm/tools/search_web.py,sha256=B24amOnGHnmdV_6S8bw8O2PdhZRRIDtJjg-wXcfP7dQ,11859
|
130
130
|
beswarm/tools/think.py,sha256=WLw-7jNIsnS6n8MMSYUin_f-BGLENFmnKM2LISEp0co,1760
|
131
131
|
beswarm/tools/worker.py,sha256=b-FvSEP27-zMYNcqaQeVBoWxaSf2cX_7_1p1GAF6h04,6191
|
132
|
-
beswarm-0.1.
|
133
|
-
beswarm-0.1.
|
134
|
-
beswarm-0.1.
|
135
|
-
beswarm-0.1.
|
132
|
+
beswarm-0.1.57.dist-info/METADATA,sha256=FdjwXDGhJw1_43unl9YjSFbzl8jB5Pu-g0KX_Hn_TNA,3553
|
133
|
+
beswarm-0.1.57.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
134
|
+
beswarm-0.1.57.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
|
135
|
+
beswarm-0.1.57.dist-info/RECORD,,
|
File without changes
|
File without changes
|