From ccfdaaee75f8081fffd68936d5bdad794563fb62 Mon Sep 17 00:00:00 2001 From: erikhalt Date: Sun, 15 Oct 2023 22:38:14 +0200 Subject: [PATCH 1/2] bugfix, see below Traceback (most recent call last): File "\Python\Python310\lib\site-packages\pyttman\tools\pyttmancli\intents.py", line 120, in respond app = bootstrap_app(devmode=True, module=app_name) File "\Python\Python310\lib\site-packages\pyttman\tools\pyttmancli\terraforming.py", line 157, in bootstrap_app depr_raise("Please rename 'MESSAGE_ROUTER' to 'MIDDLEWARE' in " File "\Python\Python310\lib\site-packages\pyttman\core\internals.py", line 26, in depr_raise raise DeprecationWarning(out) DeprecationWarning: Please rename 'MESSAGE_ROUTER' to 'MIDDLEWARE' in 'settings.py' for this application. - This was deprecated in version 1.1.11. --- pyttman/core/internals.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pyttman/core/internals.py b/pyttman/core/internals.py index 97b09ca..0cf75b7 100644 --- a/pyttman/core/internals.py +++ b/pyttman/core/internals.py @@ -35,6 +35,12 @@ def depr_graceful(message: str, version: str): out = f"{message} - This was deprecated in version {version}." warnings.warn(out, DeprecationWarning) +class CustomUserDict(UserDict): + + def __init__(self, dictionary): + self.data = dictionary + self.__dict__.update(dictionary) + class Settings: """ Dataclass holding settings configured in the settings.py @@ -85,7 +91,7 @@ def __repr__(self): @staticmethod def _dict_to_object(dictionary): - return json.loads(json.dumps(dictionary), object_hook=Settings) + return json.loads(json.dumps(dictionary), object_hook=CustomUserDict) def _generate_name(name): """ From ec73cc475b3377b85737c1e6ab44d9168bd9b995 Mon Sep 17 00:00:00 2001 From: erikhalt Date: Mon, 16 Oct 2023 20:04:11 +0200 Subject: [PATCH 2/2] FR changed logger output from-see below Pyttman\pyttman\tools\pyttmancli\terraforming.py 144: logger = logging.getLogger(f"Pyttman logger") to-see below Pyttman\pyttman\tools\pyttmancli\terraforming.py 144: logger = logging.getLogger(f"Pyttman logger on app {app_name}") --- pyttman/tools/pyttmancli/terraforming.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyttman/tools/pyttmancli/terraforming.py b/pyttman/tools/pyttmancli/terraforming.py index 3a79acc..3e0f956 100644 --- a/pyttman/tools/pyttmancli/terraforming.py +++ b/pyttman/tools/pyttmancli/terraforming.py @@ -141,7 +141,7 @@ def bootstrap_app(module: str = None, devmode: bool = False, logging_format = logging.BASIC_FORMAT logging_handle.setFormatter(logging.Formatter(logging_format)) - logger = logging.getLogger("Pyttman logger") + logger = logging.getLogger(f"Pyttman logger on app {app_name}") logger.setLevel(logging.DEBUG) logger.addHandler(logging_handle)