Closed Ovi3 closed 3 years ago
执行 python3 pydictor.py -tool handler raw.txt --regex .*?\d+ 命令时得不到正确的结果,就pr一个: https://github.com/LandGrey/pydictor/pull/20。因为开发环境问题,.gitignore要做修改,还是直接提issue
python3 pydictor.py -tool handler raw.txt --regex .*?\d+
https://github.com/LandGrey/pydictor/pull/20
这里https://github.com/LandGrey/pydictor/blob/master/lib/parse/command.py#L122解析regex参数,因为带有nargs=1,所以args.regex是list类型,它被赋值给了pyoptions.filter_regex。 pyoptions.filter_regex传给了regex_filter函数:https://github.com/LandGrey/pydictor/blob/master/lib/fun/filter.py#L245。该函数的regex参数需要str类型,不是list类型
https://github.com/LandGrey/pydictor/blob/master/lib/parse/command.py#L122
https://github.com/LandGrey/pydictor/blob/master/lib/fun/filter.py#L245
确认是在某次 [较早的更新] (https://github.com/LandGrey/pydictor/commit/0c068abbada07d80d7ee1f743857206788e8b87c#diff-b35e0d845c4ccb8f58bac52a3b5fc7e6) 中写错又没有测试出该问题,已修复此 bug ,再次感谢。
执行
python3 pydictor.py -tool handler raw.txt --regex .*?\d+
命令时得不到正确的结果,就pr一个:https://github.com/LandGrey/pydictor/pull/20
。因为开发环境问题,.gitignore要做修改,还是直接提issue这里
https://github.com/LandGrey/pydictor/blob/master/lib/parse/command.py#L122
解析regex参数,因为带有nargs=1,所以args.regex是list类型,它被赋值给了pyoptions.filter_regex。 pyoptions.filter_regex传给了regex_filter函数:https://github.com/LandGrey/pydictor/blob/master/lib/fun/filter.py#L245
。该函数的regex参数需要str类型,不是list类型