Удаление ненужных импортов локалей

This commit is contained in:
parent ec054bbaad
commit c326edfb9a

View file

@ -60,10 +60,6 @@ class DeviceInfoCollector:
self.mac_lookup = MacLookup()
self.nbtscan_cache = {}
self.nbtscan_results = {}
if not hasattr(translations, 'gettext'):
logger.warning("Translations object does not support gettext, using fallback")
self.translations = Translations.load("utils/locales/en/LC_MESSAGES/services.mo")
else:
self.translations = translations
@lru_cache(maxsize=1000)
@ -123,10 +119,6 @@ class DeviceStorage:
self.storage_file = Path(storage_path)
self.storage_file.parent.mkdir(parents=True, exist_ok=True)
self.offline_timeout = timedelta(days=7)
if not hasattr(translations, 'gettext'):
logger.warning("Translations object does not support gettext, using fallback")
self.translations = Translations.load("utils/locales/en/LC_MESSAGES/services.mo")
else:
self.translations = translations
def load_devices(self) -> Dict[str, Device]:
@ -186,10 +178,6 @@ class SubnetService:
self.port_scanner = PortScanner(self.interface)
self.device_info = DeviceInfoCollector()
self.storage = DeviceStorage()
if not hasattr(translations, 'gettext'):
logger.warning("Translations object does not support gettext, using fallback")
self.translations = Translations.load("utils/locales/en/LC_MESSAGES/services.mo")
else:
self.translations = translations
logger.info(f"Initialized SubnetService with interface: {self.interface}")