From 0f16e77b827c765173097f73e22218d37a4c0948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Thu, 31 Aug 2023 02:39:35 +0200 Subject: [PATCH] Before moving userinterface _data dict to dataclass --- server/src/uds/core/ui/user_interface.py | 3 --- server/src/uds/core/util/decorators.py | 4 ++-- server/src/uds/core/workers/log.py | 2 -- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/server/src/uds/core/ui/user_interface.py b/server/src/uds/core/ui/user_interface.py index 5f80bef1b..5b40732b8 100644 --- a/server/src/uds/core/ui/user_interface.py +++ b/server/src/uds/core/ui/user_interface.py @@ -43,9 +43,7 @@ import typing import collections.abc import abc -from django.utils.translation import get_language from django.utils.translation import gettext as _ -from django.utils.translation import gettext_noop from uds.core import exceptions, types from uds.core.managers.crypto import UDSK, CryptoManager @@ -1398,7 +1396,6 @@ class UserInterface(metaclass=UserInterfaceType): obj: If any, object that will get its "initGui" invoked This will only happen (not to be None) in Services. """ - logger.debug('Active language for theGui translation: %s', get_language()) self.initGui() # We give the "oportunity" to fill necesary theGui data before providing it to client res: typing.List[typing.MutableMapping[str, typing.Any]] = [] diff --git a/server/src/uds/core/util/decorators.py b/server/src/uds/core/util/decorators.py index 30f8a8843..89b5fa96c 100644 --- a/server/src/uds/core/util/decorators.py +++ b/server/src/uds/core/util/decorators.py @@ -158,8 +158,8 @@ def deprecatedClassValue(newVarName: str) -> typing.Callable: logger.warning( 'Use of deprecated class value %s from %s:%s. Use %s instead.', self.fget.__name__, - caller[1], - caller[2], + caller.filename, + caller.lineno, self.new_var_name, ) except Exception: diff --git a/server/src/uds/core/workers/log.py b/server/src/uds/core/workers/log.py index e663a0c24..f76900928 100644 --- a/server/src/uds/core/workers/log.py +++ b/server/src/uds/core/workers/log.py @@ -70,5 +70,3 @@ class LogMaintenance(Job): for record in models.Log.objects.filter(owner_id=owner_id, owner_type=owner_type).order_by('created', 'id')[: count - max_elements + 1]: record.delete() -# class DelayedLog(Job): -# pass \ No newline at end of file