diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py index 7c49cc0d..5bfebd7b 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py @@ -1340,17 +1340,20 @@ class dialog_setting_game_internal(QWidget): _dict["postprocessconfig"].pop(post) def __privatetextproc_btn1(self): - __viss = [ - postprocessconfig[_internal]["name"] for _internal in postprocessconfig - ] - def __callback(d): - __ = list(postprocessconfig.keys())[d["k"]] + __viss = [] + _internal = [] + for xx in postprocessconfig: __list = savehook_new_data[self.__privatetextproc_gameuid][ "save_text_process_info" ]["rank"] - if __ in __list: - return + if xx in __list: + continue + __viss.append(postprocessconfig[xx]["name"]) + _internal.append(xx) + + def __callback(_internal, d): + __ = _internal[d["k"]] __list.insert(0, __) self.__checkaddnewmethod(0, __) @@ -1369,7 +1372,7 @@ class dialog_setting_game_internal(QWidget): }, { "type": "okcancel", - "callback": functools.partial(__callback, __d), + "callback": functools.partial(__callback, _internal, __d), }, ], ) diff --git a/LunaTranslator/LunaTranslator/myutils/config.py b/LunaTranslator/LunaTranslator/myutils/config.py index 9076e6fc..55b8ee44 100644 --- a/LunaTranslator/LunaTranslator/myutils/config.py +++ b/LunaTranslator/LunaTranslator/myutils/config.py @@ -427,7 +427,7 @@ if ocrerrorfix == {}: ocrerrorfix = postprocessconfig["_100"] else: ocrerrorfix = ocrerrorfixdefault -syncconfig(postprocessconfig, defaultpost, True, 3) +syncconfig(postprocessconfig, defaultpost, deep=3) if needcast: diff --git a/LunaTranslator/LunaTranslator/myutils/post.py b/LunaTranslator/LunaTranslator/myutils/post.py index 7c91bf7a..1e7f1949 100644 --- a/LunaTranslator/LunaTranslator/myutils/post.py +++ b/LunaTranslator/LunaTranslator/myutils/post.py @@ -2,7 +2,13 @@ import re, codecs, inspect from traceback import print_exc from collections import Counter import gobject -from myutils.utils import checkchaos, checkmd5reloadmodule, LRUCache, getlangsrc, parsemayberegexreplace +from myutils.utils import ( + checkchaos, + checkmd5reloadmodule, + LRUCache, + getlangsrc, + parsemayberegexreplace, +) from myutils.config import ( postprocessconfig, globalconfig, @@ -362,11 +368,11 @@ def POSTSOLVE(line): "_6EX": _6_fEX, "_91": _91_f, "_92": _92_f, - "_7": _7_f, - "_8": _8_f, + "_7": _7_f, # depracated + "_8": _8_f, # depracated "_13": _13_f, "_13EX": _13_fEX, - "_7_zhuanyi": _7_zhuanyi_f, + "_7_zhuanyi": _7_zhuanyi_f, # depracated "_remove_non_shiftjis_char": _remove_non_shiftjis_char, "_remove_control": _remove_control, "_remove_chaos": _remove_chaos, diff --git a/LunaTranslator/files/defaultconfig/postprocessconfig.json b/LunaTranslator/files/defaultconfig/postprocessconfig.json index dddff35f..d2b3a0e1 100644 --- a/LunaTranslator/files/defaultconfig/postprocessconfig.json +++ b/LunaTranslator/files/defaultconfig/postprocessconfig.json @@ -162,27 +162,6 @@ "use": false, "name": "过滤英文字母" }, - "_7": { - "use": true, - "name": "!_不推荐使用_简单字符串替换_!", - "args": { - "替换内容": {} - } - }, - "_7_zhuanyi": { - "use": true, - "name": "!_不推荐使用_转义字符串替换_!", - "args": { - "替换内容": {} - } - }, - "_8": { - "use": false, - "name": "!_不推荐使用_正则表达式替换_!", - "args": { - "替换内容": {} - } - }, "_10": { "use": false, "name": "去除重复行_ABCDBCDCDD->ABCD"