PyWSGIRef 1.1.22__tar.gz → 1.1.23__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.
Files changed (25) hide show
  1. {pywsgiref-1.1.22/src/PyWSGIRef.egg-info → pywsgiref-1.1.23}/PKG-INFO +20 -3
  2. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/README.md +19 -2
  3. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/pyproject.toml +1 -1
  4. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/src/PyWSGIRef/__init__.py +3 -3
  5. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/src/PyWSGIRef/macro.py +1 -1
  6. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/src/PyWSGIRef/pyhtml.py +2 -2
  7. {pywsgiref-1.1.22 → pywsgiref-1.1.23/src/PyWSGIRef.egg-info}/PKG-INFO +20 -3
  8. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/LICENSE +0 -0
  9. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/setup.cfg +0 -0
  10. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/src/PyWSGIRef/__main__.py +0 -0
  11. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/src/PyWSGIRef/beta.py +0 -0
  12. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/src/PyWSGIRef/commons.py +0 -0
  13. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/src/PyWSGIRef/defaults.py +0 -0
  14. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/src/PyWSGIRef/exceptions.py +0 -0
  15. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/src/PyWSGIRef/finished.py +0 -0
  16. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/src/PyWSGIRef/loadContent.py +0 -0
  17. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/src/PyWSGIRef/patterns.py +0 -0
  18. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/src/PyWSGIRef/simpleServer.py +0 -0
  19. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/src/PyWSGIRef/stats.py +0 -0
  20. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/src/PyWSGIRef/templateDict.py +0 -0
  21. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/src/PyWSGIRef.egg-info/SOURCES.txt +0 -0
  22. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/src/PyWSGIRef.egg-info/dependency_links.txt +0 -0
  23. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/src/PyWSGIRef.egg-info/requires.txt +0 -0
  24. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/src/PyWSGIRef.egg-info/top_level.txt +0 -0
  25. {pywsgiref-1.1.22 → pywsgiref-1.1.23}/tests/testMainServer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyWSGIRef
3
- Version: 1.1.22
3
+ Version: 1.1.23
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
@@ -16,8 +16,11 @@ Requires-Dist: naturalsize
16
16
  Dynamic: license-file
17
17
 
18
18
  # PyWSGIRef
19
+
19
20
  easy server-setup
21
+
20
22
  ## Advantage
23
+
21
24
  Many web services offer simple ways to set up a WSGI webserver.<br/>
22
25
  The built-in WSGI server in Python is, however, not very easy to use.<br/>
23
26
  PyWSGIRef provides a simple way to set up a WSGI server with minimal code.<br/><br/>
@@ -28,14 +31,18 @@ before the server is running.<br/><br/>
28
31
  PyHTML files are HTML files that can contain {}-s for Python formatting or<br/>
29
32
  (upcoming) code blocks or shortened HTML, which can be used to create dynamic HTML content.<br/>
30
33
  PyWSGIRef also provides a simple way to decode these.
34
+
31
35
  ## Installation
36
+
32
37
  ### Using *pip*
38
+
33
39
  You can install PyWSGIRef via pip using
34
40
  <li>in a commandline:</li><br/>
35
41
 
36
42
  ```bash
37
43
  py -m pip install PyWSGIRef
38
44
  ```
45
+
39
46
  <br/>
40
47
  <li>in a python script:</li><br/>
41
48
 
@@ -43,8 +50,11 @@ py -m pip install PyWSGIRef
43
50
  import os
44
51
  os.system('py -m pip install PyWSGIRef')
45
52
  ```
53
+
46
54
  ## Usage
55
+
47
56
  ### Setting up the WSGI server
57
+
48
58
  ```python
49
59
  from PyWSGIRef import *
50
60
 
@@ -166,7 +176,11 @@ You may include CSS, JS, JSON and ICO files.<br/><br/>
166
176
  With the <code><{{evalPyHTML-script: alert('Hello, World!'); :script-}}></code> phrase,<br/>
167
177
  you can add a script block anywhere inside your PyHTML file.<br/>
168
178
  Using pretty much the same syntax, you can also add a style block using
169
- <code><{{evalPyHTML-style: body { background-color: lightblue; } :style-}}></code>.
179
+ <code><{{evalPyHTML-style: body { background-color: lightblue; } :style-}}></code>.<br/><br/>
180
+
181
+ PyHTML can also execute some Python code inline via the python code block <code><{{evalPyHTML-eval: :eval-}}></code>.<br/>
182
+ You may specify the context the code is executed in using the decodedContext method of the PyHTML class.<br/>
183
+ <b>WARNING</b>: Be careful which Python code is executed on your server!
170
184
 
171
185
  ### Stats
172
186
  Some stats are saved into the <code>STATS</code> object.<br/>
@@ -187,13 +201,16 @@ server.shutdown()
187
201
  ```
188
202
 
189
203
  ### Others
204
+
190
205
  Use the following to get information about your release and the author of the module:
191
206
  ```python
192
207
  from PyWSGIRef import about
193
208
 
194
209
  about()
195
210
  ```
211
+
196
212
  ### Curious?
213
+
197
214
  Join the <b>BETA</b> group to get new features even earlier!<br/>
198
215
  Note that BETA features may not be tested when using them.
199
216
  ```python
@@ -203,7 +220,6 @@ from PyWSGIRef import BETA
203
220
  BETA.enable()
204
221
  ```
205
222
  Currently to be tested are:<br/>
206
- - PyHTML python script blocks<br/>
207
223
  - PyHTML python if clause blocks<br/>
208
224
  - PyHTML macros<br/><br/>
209
225
 
@@ -211,4 +227,5 @@ Currently to be tested are:<br/>
211
227
  Please report any bugs you find in the GitHub repository and suggest new features!<br/><br/>
212
228
 
213
229
  Thanks a lot for helping improving PyWSGIRef!
230
+
214
231
  ### More coming soon
@@ -1,6 +1,9 @@
1
1
  # PyWSGIRef
2
+
2
3
  easy server-setup
4
+
3
5
  ## Advantage
6
+
4
7
  Many web services offer simple ways to set up a WSGI webserver.<br/>
5
8
  The built-in WSGI server in Python is, however, not very easy to use.<br/>
6
9
  PyWSGIRef provides a simple way to set up a WSGI server with minimal code.<br/><br/>
@@ -11,14 +14,18 @@ before the server is running.<br/><br/>
11
14
  PyHTML files are HTML files that can contain {}-s for Python formatting or<br/>
12
15
  (upcoming) code blocks or shortened HTML, which can be used to create dynamic HTML content.<br/>
13
16
  PyWSGIRef also provides a simple way to decode these.
17
+
14
18
  ## Installation
19
+
15
20
  ### Using *pip*
21
+
16
22
  You can install PyWSGIRef via pip using
17
23
  <li>in a commandline:</li><br/>
18
24
 
19
25
  ```bash
20
26
  py -m pip install PyWSGIRef
21
27
  ```
28
+
22
29
  <br/>
23
30
  <li>in a python script:</li><br/>
24
31
 
@@ -26,8 +33,11 @@ py -m pip install PyWSGIRef
26
33
  import os
27
34
  os.system('py -m pip install PyWSGIRef')
28
35
  ```
36
+
29
37
  ## Usage
38
+
30
39
  ### Setting up the WSGI server
40
+
31
41
  ```python
32
42
  from PyWSGIRef import *
33
43
 
@@ -149,7 +159,11 @@ You may include CSS, JS, JSON and ICO files.<br/><br/>
149
159
  With the <code><{{evalPyHTML-script: alert('Hello, World!'); :script-}}></code> phrase,<br/>
150
160
  you can add a script block anywhere inside your PyHTML file.<br/>
151
161
  Using pretty much the same syntax, you can also add a style block using
152
- <code><{{evalPyHTML-style: body { background-color: lightblue; } :style-}}></code>.
162
+ <code><{{evalPyHTML-style: body { background-color: lightblue; } :style-}}></code>.<br/><br/>
163
+
164
+ PyHTML can also execute some Python code inline via the python code block <code><{{evalPyHTML-eval: :eval-}}></code>.<br/>
165
+ You may specify the context the code is executed in using the decodedContext method of the PyHTML class.<br/>
166
+ <b>WARNING</b>: Be careful which Python code is executed on your server!
153
167
 
154
168
  ### Stats
155
169
  Some stats are saved into the <code>STATS</code> object.<br/>
@@ -170,13 +184,16 @@ server.shutdown()
170
184
  ```
171
185
 
172
186
  ### Others
187
+
173
188
  Use the following to get information about your release and the author of the module:
174
189
  ```python
175
190
  from PyWSGIRef import about
176
191
 
177
192
  about()
178
193
  ```
194
+
179
195
  ### Curious?
196
+
180
197
  Join the <b>BETA</b> group to get new features even earlier!<br/>
181
198
  Note that BETA features may not be tested when using them.
182
199
  ```python
@@ -186,7 +203,6 @@ from PyWSGIRef import BETA
186
203
  BETA.enable()
187
204
  ```
188
205
  Currently to be tested are:<br/>
189
- - PyHTML python script blocks<br/>
190
206
  - PyHTML python if clause blocks<br/>
191
207
  - PyHTML macros<br/><br/>
192
208
 
@@ -194,4 +210,5 @@ Currently to be tested are:<br/>
194
210
  Please report any bugs you find in the GitHub repository and suggest new features!<br/><br/>
195
211
 
196
212
  Thanks a lot for helping improving PyWSGIRef!
213
+
197
214
  ### More coming soon
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "PyWSGIRef"
3
- version = "1.1.22"
3
+ version = "1.1.23"
4
4
  authors = [
5
5
  {name="Leander Kafemann", email="leander.kafemann+python@icloud.com" },
6
6
  ]
@@ -19,7 +19,7 @@ def about():
19
19
  """
20
20
  Returns information about your release and other projects by Leander Kafemann
21
21
  """
22
- return {"Version": (1, 1, 22), "Author": "Leander Kafemann", "date": "29.09.2026",\
22
+ return {"Version": (1, 1, 23), "Author": "Leander Kafemann", "date": "29.09.2026",\
23
23
  "recommend": ("pyimager"), "feedbackTo": "leander.kafemann+python@icloud.com"}
24
24
 
25
25
  SCHABLONEN = TemplateDict()
@@ -35,14 +35,14 @@ def addSchablone(name: str, content: str):
35
35
  raise ServerAlreadyGeneratedError()
36
36
  SCHABLONEN[name] = PyHTML(content, macros=MACROS)
37
37
 
38
- def addMacro(name: str, content: PyHTML):
38
+ def addMacro(name: str, content: str):
39
39
  """
40
40
  Adds a macro to the MACROS dictionary.
41
41
  """
42
42
  global MACROS
43
43
  if finished.value:
44
44
  raise ServerAlreadyGeneratedError()
45
- MACROS[name] = content
45
+ MACROS[name] = PyHTML(content)
46
46
 
47
47
  def multiWebInit(baseURL: str, templateNames: list[str], overrideException: bool = False) -> list[str]:
48
48
  """
@@ -20,7 +20,7 @@ class MacroDict:
20
20
  raise TypeError("Key must be a string.")
21
21
  if self.locked.value:
22
22
  raise ServerAlreadyGeneratedError("Cannot modify macros after it has been locked.")
23
- self.macros[key] = value.decoded(cacheDecoded=True)
23
+ self.macros[key] = value.decoded()
24
24
 
25
25
  def __contains__(self, key: str):
26
26
  return key in self.macros
@@ -137,7 +137,7 @@ class PyHTML:
137
137
  name = match.group(1)
138
138
  if name not in macros:
139
139
  raise KeyError(f"Unknown macro: {name}")
140
- replacement = macros[name].decoded()
140
+ replacement = macros[name]
141
141
  self.html = self.html[:match.start()] + replacement + self.html[match.end():]
142
142
 
143
143
  def decode(self, macros=None):
@@ -152,8 +152,8 @@ class PyHTML:
152
152
  self._replace_style_blocks()
153
153
  self._replace_includes()
154
154
  self._replace_macros(macros)
155
+ self._replace_eval_blocks()
155
156
  if BETA.value:
156
- self._replace_eval_blocks()
157
157
  self._replace_if_blocks()
158
158
 
159
159
  def decoded(self, cacheDecoded: bool = False, macros=None) -> str:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyWSGIRef
3
- Version: 1.1.22
3
+ Version: 1.1.23
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
@@ -16,8 +16,11 @@ Requires-Dist: naturalsize
16
16
  Dynamic: license-file
17
17
 
18
18
  # PyWSGIRef
19
+
19
20
  easy server-setup
21
+
20
22
  ## Advantage
23
+
21
24
  Many web services offer simple ways to set up a WSGI webserver.<br/>
22
25
  The built-in WSGI server in Python is, however, not very easy to use.<br/>
23
26
  PyWSGIRef provides a simple way to set up a WSGI server with minimal code.<br/><br/>
@@ -28,14 +31,18 @@ before the server is running.<br/><br/>
28
31
  PyHTML files are HTML files that can contain {}-s for Python formatting or<br/>
29
32
  (upcoming) code blocks or shortened HTML, which can be used to create dynamic HTML content.<br/>
30
33
  PyWSGIRef also provides a simple way to decode these.
34
+
31
35
  ## Installation
36
+
32
37
  ### Using *pip*
38
+
33
39
  You can install PyWSGIRef via pip using
34
40
  <li>in a commandline:</li><br/>
35
41
 
36
42
  ```bash
37
43
  py -m pip install PyWSGIRef
38
44
  ```
45
+
39
46
  <br/>
40
47
  <li>in a python script:</li><br/>
41
48
 
@@ -43,8 +50,11 @@ py -m pip install PyWSGIRef
43
50
  import os
44
51
  os.system('py -m pip install PyWSGIRef')
45
52
  ```
53
+
46
54
  ## Usage
55
+
47
56
  ### Setting up the WSGI server
57
+
48
58
  ```python
49
59
  from PyWSGIRef import *
50
60
 
@@ -166,7 +176,11 @@ You may include CSS, JS, JSON and ICO files.<br/><br/>
166
176
  With the <code><{{evalPyHTML-script: alert('Hello, World!'); :script-}}></code> phrase,<br/>
167
177
  you can add a script block anywhere inside your PyHTML file.<br/>
168
178
  Using pretty much the same syntax, you can also add a style block using
169
- <code><{{evalPyHTML-style: body { background-color: lightblue; } :style-}}></code>.
179
+ <code><{{evalPyHTML-style: body { background-color: lightblue; } :style-}}></code>.<br/><br/>
180
+
181
+ PyHTML can also execute some Python code inline via the python code block <code><{{evalPyHTML-eval: :eval-}}></code>.<br/>
182
+ You may specify the context the code is executed in using the decodedContext method of the PyHTML class.<br/>
183
+ <b>WARNING</b>: Be careful which Python code is executed on your server!
170
184
 
171
185
  ### Stats
172
186
  Some stats are saved into the <code>STATS</code> object.<br/>
@@ -187,13 +201,16 @@ server.shutdown()
187
201
  ```
188
202
 
189
203
  ### Others
204
+
190
205
  Use the following to get information about your release and the author of the module:
191
206
  ```python
192
207
  from PyWSGIRef import about
193
208
 
194
209
  about()
195
210
  ```
211
+
196
212
  ### Curious?
213
+
197
214
  Join the <b>BETA</b> group to get new features even earlier!<br/>
198
215
  Note that BETA features may not be tested when using them.
199
216
  ```python
@@ -203,7 +220,6 @@ from PyWSGIRef import BETA
203
220
  BETA.enable()
204
221
  ```
205
222
  Currently to be tested are:<br/>
206
- - PyHTML python script blocks<br/>
207
223
  - PyHTML python if clause blocks<br/>
208
224
  - PyHTML macros<br/><br/>
209
225
 
@@ -211,4 +227,5 @@ Currently to be tested are:<br/>
211
227
  Please report any bugs you find in the GitHub repository and suggest new features!<br/><br/>
212
228
 
213
229
  Thanks a lot for helping improving PyWSGIRef!
230
+
214
231
  ### More coming soon
File without changes
File without changes