PyWSGIRef 1.1.18__tar.gz → 1.1.19__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.
- {pywsgiref-1.1.18/src/PyWSGIRef.egg-info → pywsgiref-1.1.19}/PKG-INFO +4 -1
- {pywsgiref-1.1.18 → pywsgiref-1.1.19}/README.md +3 -0
- {pywsgiref-1.1.18 → pywsgiref-1.1.19}/pyproject.toml +1 -1
- {pywsgiref-1.1.18 → pywsgiref-1.1.19}/src/PyWSGIRef/__init__.py +1 -1
- {pywsgiref-1.1.18 → pywsgiref-1.1.19}/src/PyWSGIRef/pyhtml.py +14 -4
- {pywsgiref-1.1.18 → pywsgiref-1.1.19}/src/PyWSGIRef/stats.py +4 -3
- {pywsgiref-1.1.18 → pywsgiref-1.1.19/src/PyWSGIRef.egg-info}/PKG-INFO +4 -1
- {pywsgiref-1.1.18 → pywsgiref-1.1.19}/LICENSE +0 -0
- {pywsgiref-1.1.18 → pywsgiref-1.1.19}/setup.cfg +0 -0
- {pywsgiref-1.1.18 → pywsgiref-1.1.19}/src/PyWSGIRef/__main__.py +0 -0
- {pywsgiref-1.1.18 → pywsgiref-1.1.19}/src/PyWSGIRef/beta.py +0 -0
- {pywsgiref-1.1.18 → pywsgiref-1.1.19}/src/PyWSGIRef/commons.py +0 -0
- {pywsgiref-1.1.18 → pywsgiref-1.1.19}/src/PyWSGIRef/defaults.py +0 -0
- {pywsgiref-1.1.18 → pywsgiref-1.1.19}/src/PyWSGIRef/exceptions.py +0 -0
- {pywsgiref-1.1.18 → pywsgiref-1.1.19}/src/PyWSGIRef/finished.py +0 -0
- {pywsgiref-1.1.18 → pywsgiref-1.1.19}/src/PyWSGIRef/loadContent.py +0 -0
- {pywsgiref-1.1.18 → pywsgiref-1.1.19}/src/PyWSGIRef/patterns.py +0 -0
- {pywsgiref-1.1.18 → pywsgiref-1.1.19}/src/PyWSGIRef/simpleServer.py +0 -0
- {pywsgiref-1.1.18 → pywsgiref-1.1.19}/src/PyWSGIRef/templateDict.py +0 -0
- {pywsgiref-1.1.18 → pywsgiref-1.1.19}/src/PyWSGIRef.egg-info/SOURCES.txt +0 -0
- {pywsgiref-1.1.18 → pywsgiref-1.1.19}/src/PyWSGIRef.egg-info/dependency_links.txt +0 -0
- {pywsgiref-1.1.18 → pywsgiref-1.1.19}/src/PyWSGIRef.egg-info/requires.txt +0 -0
- {pywsgiref-1.1.18 → pywsgiref-1.1.19}/src/PyWSGIRef.egg-info/top_level.txt +0 -0
- {pywsgiref-1.1.18 → pywsgiref-1.1.19}/tests/testMainServer.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyWSGIRef
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.19
|
|
4
4
|
Summary: easy server-setup
|
|
5
5
|
Author-email: Leander Kafemann <leander.kafemann+python@icloud.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/LeanderKafemann/PyWSGIRef
|
|
@@ -200,5 +200,8 @@ Currently to be tested are:<br/>
|
|
|
200
200
|
- application object running time measuring<br/>
|
|
201
201
|
- application object counter of access<br/><br/>
|
|
202
202
|
|
|
203
|
+
|
|
204
|
+
Please report any bugs you find in the GitHub repository and suggest new features!<br/><br/>
|
|
205
|
+
|
|
203
206
|
Thanks a lot for helping improving PyWSGIRef!
|
|
204
207
|
### More coming soon
|
|
@@ -183,5 +183,8 @@ Currently to be tested are:<br/>
|
|
|
183
183
|
- application object running time measuring<br/>
|
|
184
184
|
- application object counter of access<br/><br/>
|
|
185
185
|
|
|
186
|
+
|
|
187
|
+
Please report any bugs you find in the GitHub repository and suggest new features!<br/><br/>
|
|
188
|
+
|
|
186
189
|
Thanks a lot for helping improving PyWSGIRef!
|
|
187
190
|
### More coming soon
|
|
@@ -18,7 +18,7 @@ def about():
|
|
|
18
18
|
"""
|
|
19
19
|
Returns information about your release and other projects by Leander Kafemann
|
|
20
20
|
"""
|
|
21
|
-
return {"Version": (1, 1,
|
|
21
|
+
return {"Version": (1, 1, 19), "Author": "Leander Kafemann", "date": "29.05.2026",\
|
|
22
22
|
"recommend": ("pyimager"), "feedbackTo": "leander.kafemann+python@icloud.com"}
|
|
23
23
|
|
|
24
24
|
SCHABLONEN = TemplateDict()
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import html
|
|
2
1
|
import re
|
|
3
2
|
from naturalsize import replStrPassage
|
|
4
3
|
|
|
@@ -62,21 +61,29 @@ class PyHTML:
|
|
|
62
61
|
"""
|
|
63
62
|
Replaces script replacement phrases with JS scripts.
|
|
64
63
|
"""
|
|
64
|
+
offset = 0
|
|
65
65
|
for match in re.finditer(SCRIPT_PATTERN, self.html, re.DOTALL):
|
|
66
66
|
idx, idxEnd = match.span()
|
|
67
|
+
idx += offset
|
|
68
|
+
idxEnd += offset
|
|
67
69
|
script_content = match.group(1).strip()
|
|
68
70
|
replacement = f"<script>{script_content}</script>"
|
|
69
71
|
self.html = self.html[:idx] + replacement + self.html[idxEnd:]
|
|
72
|
+
offset += len(replacement) - (idxEnd - idx)
|
|
70
73
|
|
|
71
74
|
def _replace_style_blocks(self):
|
|
72
75
|
"""
|
|
73
76
|
Replaces style replacement phrases with CSS styles.
|
|
74
77
|
"""
|
|
78
|
+
offset = 0
|
|
75
79
|
for match in re.finditer(STYLE_PATTERN, self.html, re.DOTALL):
|
|
76
80
|
idx, idxEnd = match.span()
|
|
81
|
+
idx += offset
|
|
82
|
+
idxEnd += offset
|
|
77
83
|
style_content = match.group(1).strip()
|
|
78
84
|
replacement = f"<style>{style_content}</style>"
|
|
79
85
|
self.html = self.html[:idx] + replacement + self.html[idxEnd:]
|
|
86
|
+
offset += len(replacement) - (idxEnd - idx)
|
|
80
87
|
|
|
81
88
|
def _replace_eval_blocks(self):
|
|
82
89
|
"""
|
|
@@ -85,23 +92,26 @@ class PyHTML:
|
|
|
85
92
|
"""
|
|
86
93
|
if self.context is None:
|
|
87
94
|
self.context = {}
|
|
95
|
+
offset = 0
|
|
88
96
|
for match in re.finditer(EVAL_BLOCK_PATTERN, self.html, re.DOTALL):
|
|
89
97
|
idx, idxEnd = match.span()
|
|
98
|
+
idx += offset
|
|
99
|
+
idxEnd += offset
|
|
90
100
|
code = match.group(1).strip()
|
|
91
101
|
try:
|
|
92
|
-
# eval f�r Ausdr�cke, exec f�r Statements
|
|
93
102
|
result = str(eval(code, {}, self.context))
|
|
94
103
|
except Exception as e:
|
|
95
104
|
result = f"<b>EvalError: {e}</b>"
|
|
96
105
|
self.html = self.html[:idx] + result + self.html[idxEnd:]
|
|
106
|
+
offset += len(result) - (idxEnd - idx)
|
|
97
107
|
|
|
98
108
|
def _replace_if_blocks(self, context=None):
|
|
99
109
|
"""
|
|
100
110
|
Replaces with html code based on the evaluation of conditions in if blocks.
|
|
101
111
|
"""
|
|
102
112
|
if context is None:
|
|
103
|
-
context = {}
|
|
104
|
-
|
|
113
|
+
context = self.context if self.context else {}
|
|
114
|
+
|
|
105
115
|
while True:
|
|
106
116
|
match = re.search(IF_BLOCK_PATTERN, self.html, re.DOTALL)
|
|
107
117
|
if not match:
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import datetime
|
|
2
2
|
|
|
3
3
|
class PerformanceTime:
|
|
4
|
-
def __init__(self, title: str, data: dict =
|
|
4
|
+
def __init__(self, title: str, data: dict = None):
|
|
5
5
|
self.start = datetime.datetime.now()
|
|
6
6
|
self.title = title
|
|
7
|
-
self.data = data
|
|
7
|
+
self.data = data if data is not None else {}
|
|
8
8
|
def stop(self):
|
|
9
9
|
self.end = datetime.datetime.now()
|
|
10
10
|
|
|
@@ -56,7 +56,8 @@ class Stats:
|
|
|
56
56
|
lines.append(f" {i}. {title}: started at {start} (not stopped until now)")
|
|
57
57
|
else:
|
|
58
58
|
lines.append(f" {i}. {title}: (no time data)")
|
|
59
|
-
|
|
59
|
+
if perf.data:
|
|
60
|
+
lines[-1] = lines[-1] + " data: " + ", ".join(f"{k}={v}" for k, v in perf.data.items())
|
|
60
61
|
result = "\n".join(lines) if not html else "<br>".join(lines)
|
|
61
62
|
if filename:
|
|
62
63
|
if not filename.endswith(".pywsgirefstats"):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyWSGIRef
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.19
|
|
4
4
|
Summary: easy server-setup
|
|
5
5
|
Author-email: Leander Kafemann <leander.kafemann+python@icloud.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/LeanderKafemann/PyWSGIRef
|
|
@@ -200,5 +200,8 @@ Currently to be tested are:<br/>
|
|
|
200
200
|
- application object running time measuring<br/>
|
|
201
201
|
- application object counter of access<br/><br/>
|
|
202
202
|
|
|
203
|
+
|
|
204
|
+
Please report any bugs you find in the GitHub repository and suggest new features!<br/><br/>
|
|
205
|
+
|
|
203
206
|
Thanks a lot for helping improving PyWSGIRef!
|
|
204
207
|
### More coming soon
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|