From e398dd3ac1e4134a79cf1cfc243f737b8207fe88 Mon Sep 17 00:00:00 2001 From: krateng Date: Sun, 6 Mar 2022 02:58:02 +0100 Subject: [PATCH] A few fixes --- maloja/apis/_base.py | 2 +- maloja/apis/native_v1.py | 2 +- maloja/proccontrol/profiler.py | 5 ++++- pyproject.toml | 2 +- requirements.txt | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/maloja/apis/_base.py b/maloja/apis/_base.py index b312044..4177ce3 100644 --- a/maloja/apis/_base.py +++ b/maloja/apis/_base.py @@ -58,7 +58,7 @@ class APIHandler: def wrapper(self,path:Multi=[],**keys): - log("{self.__apiname__} API request: " + str(path))# + " | Keys: " + str({k:keys.get(k) for k in keys})) + log(f"{self.__apiname__} API request: {path}")# + " | Keys: " + str({k:keys.get(k) for k in keys})) try: response.status,result = self.handle(path,keys) diff --git a/maloja/apis/native_v1.py b/maloja/apis/native_v1.py index ed9485a..b525420 100644 --- a/maloja/apis/native_v1.py +++ b/maloja/apis/native_v1.py @@ -10,7 +10,7 @@ from .. import utilities from ._apikeys import api_key_correct, checkAPIkey from . import apikeystore -from bottle import response, static_file +from bottle import response, static_file, request # nimrodel API from nimrodel import EAPI as API diff --git a/maloja/proccontrol/profiler.py b/maloja/proccontrol/profiler.py index fb47efc..069e040 100644 --- a/maloja/proccontrol/profiler.py +++ b/maloja/proccontrol/profiler.py @@ -8,7 +8,10 @@ def profile(func): profiler.enable() result = func(*args,**kwargs) profiler.disable() - pstats.Stats(profiler).dump_stats(f"dev/benchmarking/{func}.stats") + try: + pstats.Stats(profiler).dump_stats(f"dev/benchmarking/{func.__name__}.stats") + except: + pass return result return newfunc diff --git a/pyproject.toml b/pyproject.toml index 441be84..2027bf1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ classifiers = [ dependencies = [ "bottle>=0.12.16", "waitress>=1.3", - "doreah>=1.7.2, <2", + "doreah>=1.7.4, <2", "nimrodel>=0.7.0", "setproctitle>=1.1.10", #"pyvips>=2.1.16", diff --git a/requirements.txt b/requirements.txt index 540b79e..29ffca5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ bottle>=0.12.16 waitress>=1.3 -doreah>=1.7.2 +doreah>=1.7.4 nimrodel>=0.7.0 setproctitle>=1.1.10 jinja2>=2.11