mirror of
https://github.com/aclist/dztui.git
synced 2026-10-25 12:12:31 +01:00
20 lines
441 B
Python
20 lines
441 B
Python
import logging
|
|
from typing import TYPE_CHECKING
|
|
|
|
from dzgui.const.constants import APP_NAME
|
|
from dzgui.util.ip import get_local_ip, get_coords, Coords
|
|
|
|
if TYPE_CHECKING:
|
|
from pathlib import Path
|
|
|
|
logger = logging.getLogger(APP_NAME)
|
|
|
|
|
|
def get_local_coords(path: "Path") -> Coords | None:
|
|
try:
|
|
my_ip = get_local_ip()
|
|
return get_coords(path, my_ip)
|
|
except Exception as e:
|
|
logger.warn(e)
|
|
return None
|