mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
优化remove_argument,有值的设置项传入项名即可,若有重复项会全部删除
This commit is contained in:
parent
f03b614a6b
commit
f9136b9192
@ -87,9 +87,16 @@ class DriverOptions(Options):
|
|||||||
om.save(path)
|
om.save(path)
|
||||||
|
|
||||||
def remove_argument(self, value: str) -> None:
|
def remove_argument(self, value: str) -> None:
|
||||||
"""移除一个设置"""
|
"""移除一个设置
|
||||||
if value in self._arguments:
|
:param value: 设置项名,有值的设置项传入设置名称即可
|
||||||
self._arguments.remove(value)
|
:return: None
|
||||||
|
"""
|
||||||
|
del_list = []
|
||||||
|
for argument in self._arguments:
|
||||||
|
if argument.startswith(value):
|
||||||
|
del_list.append(argument)
|
||||||
|
for del_arg in del_list:
|
||||||
|
self._arguments.remove(del_arg)
|
||||||
|
|
||||||
def remove_experimental_option(self, key: str) -> None:
|
def remove_experimental_option(self, key: str) -> None:
|
||||||
"""移除一个实验设置,传入key值删除"""
|
"""移除一个实验设置,传入key值删除"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user