py4web-debug-tools 1.2.0__tar.gz → 1.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/.gitignore +2 -1
- {py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/CHANGELOG.md +6 -0
- {py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/PKG-INFO +3 -3
- {py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/pyproject.toml +2 -2
- py4web_debug_tools-1.2.1/src/py4web_debug/__about__.py +1 -0
- {py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/src/py4web_debug/core.py +2 -1
- {py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/src/py4web_debug/debugbar.py +1 -2
- {py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/src/py4web_debug/dumping.py +10 -20
- {py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/src/py4web_debug/internals.py +10 -3
- py4web_debug_tools-1.2.0/src/py4web_debug/__about__.py +0 -1
- {py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/README.md +0 -0
- {py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/src/py4web_debug/__init__.py +0 -0
- {py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/src/py4web_debug/_internals.py +0 -0
- {py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/src/py4web_debug/env.py +0 -0
- {py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/src/py4web_debug/py.typed +0 -0
- {py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/src/py4web_debug/templates/debugbar.html +0 -0
- {py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/src/py4web_debug/templates/dumpdie.html +0 -0
- {py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/src/py4web_debug/templates/error_default.html +0 -0
- {py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/src/py4web_debug/templates/fancy_dumpdie.html +0 -0
- {py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/src/py4web_debug/types.py +0 -0
- {py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/src/py4web_debug/wsgi.py +0 -0
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
<!--next-version-placeholder-->
|
|
4
4
|
|
|
5
|
+
## v1.2.1 (2024-11-20)
|
|
6
|
+
|
|
7
|
+
### Fix
|
|
8
|
+
|
|
9
|
+
* Allow logger to be set to False in case you're using py4webs default logger (PY4WEB_ERRORLOG=:stderr) ([`43639f3`](https://github.com/trialandsuccess/py4web-debug-tools/commit/43639f377d92b2f8b96bbdb31f61251fde95f831))
|
|
10
|
+
|
|
5
11
|
## v1.2.0 (2023-11-06)
|
|
6
12
|
### Feature
|
|
7
13
|
* Allow custom `error_logger` for tools.enable ([`a8301bc`](https://github.com/trialandsuccess/py4web-debug-tools/commit/a8301bc1762984fc5af420075acdc09e97bcc378))
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: py4web-debug-tools
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: Debug Tools for py4web
|
|
5
5
|
Project-URL: Documentation, https://github.com/trialandsuccess/py4web-debug-tools#readme
|
|
6
6
|
Project-URL: Issues, https://github.com/trialandsuccess/py4web-debug-tools/issues
|
|
7
7
|
Project-URL: Source, https://github.com/trialandsuccess/py4web-debug-tools
|
|
8
8
|
Author-email: Robin van der Noord <contact@trialandsuccess.nl>
|
|
9
|
-
License
|
|
9
|
+
License: MIT
|
|
10
10
|
Classifier: Development Status :: 4 - Beta
|
|
11
11
|
Classifier: Programming Language :: Python
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -110,7 +110,9 @@ exclude = ["venv", ".bak"]
|
|
|
110
110
|
[tool.ruff]
|
|
111
111
|
target-version = "py311"
|
|
112
112
|
line-length = 120
|
|
113
|
+
extend-exclude = ["*.bak/", "venv*/"]
|
|
113
114
|
|
|
115
|
+
[tool.ruff.lint]
|
|
114
116
|
select = [
|
|
115
117
|
"F", # pyflake error
|
|
116
118
|
"E", # pycodestyle error
|
|
@@ -129,8 +131,6 @@ unfixable = [
|
|
|
129
131
|
# Don't touch unused imports
|
|
130
132
|
"F401",
|
|
131
133
|
]
|
|
132
|
-
extend-exclude = ["*.bak/", "venv*/"]
|
|
133
|
-
|
|
134
134
|
ignore = [
|
|
135
135
|
"RUF013" # implicit Optional
|
|
136
136
|
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.2.1"
|
|
@@ -45,7 +45,8 @@ class DebugTools:
|
|
|
45
45
|
# error screen settings:
|
|
46
46
|
errorpage_enabled: bool = None, # value of 'enabled' is used by default
|
|
47
47
|
errorpage_renderer: T_Renderer = None,
|
|
48
|
-
|
|
48
|
+
# can be set to False to disable (e.g. when using PY4WEB_ERRORLOG: ":stderr"):
|
|
49
|
+
error_logger: T_Logger | typing.Literal[False] | None = None,
|
|
49
50
|
# debugbar settings:
|
|
50
51
|
debugbar_enabled: bool = None, # value of 'enabled' is used by default
|
|
51
52
|
debugbar_fancy_rendering: bool = True,
|
|
@@ -10,35 +10,25 @@ from .env import is_debug
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class PossiblyAsDict(typing.Protocol):
|
|
13
|
-
def as_dict(self) -> dict[str, typing.Any]:
|
|
14
|
-
...
|
|
13
|
+
def as_dict(self) -> dict[str, typing.Any]: ...
|
|
15
14
|
|
|
16
|
-
def asdict(self) -> dict[str, typing.Any]:
|
|
17
|
-
...
|
|
15
|
+
def asdict(self) -> dict[str, typing.Any]: ...
|
|
18
16
|
|
|
19
|
-
def _asdict(self) -> dict[str, typing.Any]:
|
|
20
|
-
...
|
|
17
|
+
def _asdict(self) -> dict[str, typing.Any]: ...
|
|
21
18
|
|
|
22
|
-
def _as_dict(self) -> dict[str, typing.Any]:
|
|
23
|
-
...
|
|
19
|
+
def _as_dict(self) -> dict[str, typing.Any]: ...
|
|
24
20
|
|
|
25
|
-
def to_dict(self) -> dict[str, typing.Any]:
|
|
26
|
-
...
|
|
21
|
+
def to_dict(self) -> dict[str, typing.Any]: ...
|
|
27
22
|
|
|
28
|
-
def todict(self) -> dict[str, typing.Any]:
|
|
29
|
-
...
|
|
23
|
+
def todict(self) -> dict[str, typing.Any]: ...
|
|
30
24
|
|
|
31
|
-
def _todict(self) -> dict[str, typing.Any]:
|
|
32
|
-
...
|
|
25
|
+
def _todict(self) -> dict[str, typing.Any]: ...
|
|
33
26
|
|
|
34
|
-
def _to_dict(self) -> dict[str, typing.Any]:
|
|
35
|
-
...
|
|
27
|
+
def _to_dict(self) -> dict[str, typing.Any]: ...
|
|
36
28
|
|
|
37
|
-
def __json__(self) -> dict[str, typing.Any]:
|
|
38
|
-
...
|
|
29
|
+
def __json__(self) -> dict[str, typing.Any]: ...
|
|
39
30
|
|
|
40
|
-
def as_list(self) -> list[typing.Any]:
|
|
41
|
-
...
|
|
31
|
+
def as_list(self) -> list[typing.Any]: ...
|
|
42
32
|
|
|
43
33
|
|
|
44
34
|
class DDJsonEncoder(ConfigurableJsonEncoder):
|
|
@@ -120,9 +120,13 @@ T_Logger = typing.Callable[[ErrorSnapshot], None]
|
|
|
120
120
|
class patch_py4:
|
|
121
121
|
# THIS IS ONLY CALLED ONCE, WHEN tools.enable IS CALLED OR py4web_debug.wsgi IS USED!
|
|
122
122
|
renderer: T_Renderer | None = None
|
|
123
|
-
logger: T_Logger | None = None
|
|
123
|
+
logger: T_Logger | typing.Literal[False] | None = None
|
|
124
|
+
|
|
125
|
+
def __init__(self, renderer: T_Renderer = None, logger: T_Logger | bool | None = None):
|
|
126
|
+
if logger is True:
|
|
127
|
+
# use default logger:
|
|
128
|
+
logger = None
|
|
124
129
|
|
|
125
|
-
def __init__(self, renderer: T_Renderer = None, logger: T_Logger = None):
|
|
126
130
|
def custom_catch_errors(app_name: str, func: AnyFunc) -> typing.Callable[..., str]:
|
|
127
131
|
"""Catches and logs errors in an action; also sets request.app_name"""
|
|
128
132
|
|
|
@@ -148,7 +152,10 @@ class patch_py4:
|
|
|
148
152
|
except Exception as e:
|
|
149
153
|
err_code = 500
|
|
150
154
|
snapshot = get_error_snapshot()
|
|
151
|
-
|
|
155
|
+
if self.logger is not False:
|
|
156
|
+
# False - don't log
|
|
157
|
+
# None - default logger
|
|
158
|
+
(self.logger or default_error_logger)(snapshot)
|
|
152
159
|
|
|
153
160
|
ticket_uuid = error_logger.log(request.app_name, snapshot) or "unknown"
|
|
154
161
|
response.status = err_code
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.2.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/src/py4web_debug/templates/debugbar.html
RENAMED
|
File without changes
|
{py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/src/py4web_debug/templates/dumpdie.html
RENAMED
|
File without changes
|
{py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/src/py4web_debug/templates/error_default.html
RENAMED
|
File without changes
|
{py4web_debug_tools-1.2.0 → py4web_debug_tools-1.2.1}/src/py4web_debug/templates/fancy_dumpdie.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|