Удаление ненужных импортов локалей
This commit is contained in:
parent
ec054bbaad
commit
c326edfb9a
1 changed files with 3 additions and 15 deletions
|
|
@ -60,11 +60,7 @@ class DeviceInfoCollector:
|
||||||
self.mac_lookup = MacLookup()
|
self.mac_lookup = MacLookup()
|
||||||
self.nbtscan_cache = {}
|
self.nbtscan_cache = {}
|
||||||
self.nbtscan_results = {}
|
self.nbtscan_results = {}
|
||||||
if not hasattr(translations, 'gettext'):
|
self.translations = translations
|
||||||
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)
|
@lru_cache(maxsize=1000)
|
||||||
def get_vendor(self, mac: str) -> str:
|
def get_vendor(self, mac: str) -> str:
|
||||||
|
|
@ -123,11 +119,7 @@ class DeviceStorage:
|
||||||
self.storage_file = Path(storage_path)
|
self.storage_file = Path(storage_path)
|
||||||
self.storage_file.parent.mkdir(parents=True, exist_ok=True)
|
self.storage_file.parent.mkdir(parents=True, exist_ok=True)
|
||||||
self.offline_timeout = timedelta(days=7)
|
self.offline_timeout = timedelta(days=7)
|
||||||
if not hasattr(translations, 'gettext'):
|
self.translations = translations
|
||||||
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]:
|
def load_devices(self) -> Dict[str, Device]:
|
||||||
try:
|
try:
|
||||||
|
|
@ -186,11 +178,7 @@ class SubnetService:
|
||||||
self.port_scanner = PortScanner(self.interface)
|
self.port_scanner = PortScanner(self.interface)
|
||||||
self.device_info = DeviceInfoCollector()
|
self.device_info = DeviceInfoCollector()
|
||||||
self.storage = DeviceStorage()
|
self.storage = DeviceStorage()
|
||||||
if not hasattr(translations, 'gettext'):
|
self.translations = translations
|
||||||
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}")
|
logger.info(f"Initialized SubnetService with interface: {self.interface}")
|
||||||
|
|
||||||
def _get_default_interface(self) -> str:
|
def _get_default_interface(self) -> str:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue