Fix syntax bugs
This commit is contained in:
parent
5f6cc7b05a
commit
12b6dfc6b7
@ -75,7 +75,7 @@ class AutoSearch(BoolSettingValue):
|
|||||||
|
|
||||||
values = [("naive", "Use simple/naive check."),
|
values = [("naive", "Use simple/naive check."),
|
||||||
("dns", "Use DNS requests (might be slow!)."),
|
("dns", "Use DNS requests (might be slow!)."),
|
||||||
("false": "Never search automatically.")]
|
("false", "Never search automatically.")]
|
||||||
default = "naive"
|
default = "naive"
|
||||||
|
|
||||||
def validate(self, value):
|
def validate(self, value):
|
||||||
@ -83,9 +83,6 @@ class AutoSearch(BoolSettingValue):
|
|||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return super().validate(value)
|
return super().validate(value)
|
||||||
return True
|
|
||||||
else:
|
|
||||||
return super().validate(value)
|
|
||||||
|
|
||||||
def transform(self, value):
|
def transform(self, value):
|
||||||
if value.lower() in ["naive", "dns"]:
|
if value.lower() in ["naive", "dns"]:
|
||||||
|
@ -119,7 +119,7 @@ class IntListSettingValue(ListSettingValue):
|
|||||||
vals = super().transform(value)
|
vals = super().transform(value)
|
||||||
return map(int, vals)
|
return map(int, vals)
|
||||||
|
|
||||||
def validate(self, value)
|
def validate(self, value):
|
||||||
try:
|
try:
|
||||||
self.transform(value)
|
self.transform(value)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
Loading…
Reference in New Issue
Block a user