fix(bot\recog\ocr.py):change def ocr_line(img, lang="ch") #145
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
在使用中发现,在训练界面选中训练项目时,部分不会提升的属性对应的内容会识别为空列表,会产生如下错误导致程序中断: Traceback (most recent call last):
File "D:\programs\git\UmamusumeAutoTrainer\bot\engine\executor.py", line 126, in run_work_flow
manifest.script(ctx)
File "D:\programs\git\UmamusumeAutoTrainer\module\umamusume\manifest.py", line 71, in exec_script
script_dicts[ctx.task.task_type]ctx.current_ui
File "D:\programs\git\UmamusumeAutoTrainer\module\umamusume\script\cultivate_task\cultivate.py", line 107, in script_cultivate_training_select
parse_training_result(ctx, img, train_type)
File "D:\programs\git\UmamusumeAutoTrainer\module\umamusume\script\cultivate_task\parse.py", line 274, in parse_training_result
speed_incr_text = ocr_line(sub_img_speed_incr)
File "D:\programs\git\UmamusumeAutoTrainer\bot\recog\ocr.py", line 38, in ocr_line
text += text_info[1][0]
TypeError: 'float' object is not subscriptable
通过在ocr_line函数中添加对空列表的判断并附一个标签为0的值可以简单地忽略这个问题