mirror of
https://github.com/aclist/dztui.git
synced 2026-10-30 22:52:42 +01:00
chore: clear typehinting errors
This commit is contained in:
1 parent
fe0a6711f0
commit
866c88fbb0
14 files changed
+65
-43
No files matched your search
+4
-3
@@ -13,9 +13,10 @@ gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk # noqa E402
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from queue import Queue
|
||||
from dzgui.const.enum import ServerTab
|
||||
from dzgui.controllers.mc import Controller
|
||||
from queue import Queue
|
||||
from dzgui.util.ip import Coords
|
||||
|
||||
logger = logging.getLogger(APP_NAME)
|
||||
|
||||
@@ -74,13 +75,13 @@ class CalcDist:
|
||||
dist = self.compare(self.ip)
|
||||
self.result_queue.put([self.addr, dist, self.enum])
|
||||
|
||||
def compare(self, remote: str) -> int | None:
|
||||
def compare(self, remote_ip: str) -> Haversine | None:
|
||||
prefs = self.controller.get_prefs()
|
||||
local = prefs.coords
|
||||
if local is None:
|
||||
return None
|
||||
try:
|
||||
remote = get_coords(prefs.paths.ips, remote)
|
||||
remote = get_coords(prefs.paths.ips, remote_ip)
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
|
||||
+1
-1
@@ -130,7 +130,7 @@ def is_valid_port(port: str) -> bool:
|
||||
|
||||
|
||||
@deprecated("use ips.csv")
|
||||
def get_local_coords(ip: str):
|
||||
def get_local_coords(ip: str) -> str:
|
||||
url = COORDS_API + "/" + ip
|
||||
# local res=$(curl -Ls "$url" | jq -r '"\(.lat)\n\(.lon)"')
|
||||
return url
|
||||
Reference in new issue
Block a user