mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 14:42:54 +01:00
chore: drop digit parsing from connect panel entry
This commit is contained in:
1 parent
f8be7e33d1
commit
5b5e91c2fa
1 file changed
+3
-6
@@ -26,15 +26,12 @@ def validate_port(text: str) -> bool:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def validate_ip_or_id(text: str) -> bool:
|
def validate_ip_truthy(text: str) -> bool:
|
||||||
try:
|
try:
|
||||||
validate_ip(text)
|
validate_ip(text)
|
||||||
return True
|
return True
|
||||||
except Exception:
|
except Exception:
|
||||||
if text.isdigit():
|
return False
|
||||||
return True
|
|
||||||
else:
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
class ValidatedEntry(Gtk.Entry):
|
class ValidatedEntry(Gtk.Entry):
|
||||||
@@ -124,7 +121,7 @@ class IpEntry(ValidatedEntry):
|
|||||||
def __init__(self, controller: "Controller") -> None:
|
def __init__(self, controller: "Controller") -> None:
|
||||||
super().__init__(
|
super().__init__(
|
||||||
controller,
|
controller,
|
||||||
func=validate_ip_or_id,
|
func=validate_ip_truthy,
|
||||||
placeholder_text=connect_panel.placeholder,
|
placeholder_text=connect_panel.placeholder,
|
||||||
tooltip_text=connect_panel.entry_tooltip,
|
tooltip_text=connect_panel.entry_tooltip,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user