PyWSGIRef 1.1.16__tar.gz → 1.1.17__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.16/src/PyWSGIRef.egg-info → pywsgiref-1.1.17}/PKG-INFO +1 -1
  2. {pywsgiref-1.1.16 → pywsgiref-1.1.17}/pyproject.toml +1 -1
  3. {pywsgiref-1.1.16 → pywsgiref-1.1.17}/src/PyWSGIRef/__init__.py +6 -2
  4. {pywsgiref-1.1.16 → pywsgiref-1.1.17}/src/PyWSGIRef/loadContent.py +3 -2
  5. {pywsgiref-1.1.16 → pywsgiref-1.1.17}/src/PyWSGIRef/pyhtml.py +1 -1
  6. {pywsgiref-1.1.16 → pywsgiref-1.1.17/src/PyWSGIRef.egg-info}/PKG-INFO +1 -1
  7. pywsgiref-1.1.17/tests/testMainServer.py +3 -0
  8. pywsgiref-1.1.16/tests/testMainServer.py +0 -3
  9. {pywsgiref-1.1.16 → pywsgiref-1.1.17}/LICENSE +0 -0
  10. {pywsgiref-1.1.16 → pywsgiref-1.1.17}/README.md +0 -0
  11. {pywsgiref-1.1.16 → pywsgiref-1.1.17}/setup.cfg +0 -0
  12. {pywsgiref-1.1.16 → pywsgiref-1.1.17}/src/PyWSGIRef/__main__.py +0 -0
  13. {pywsgiref-1.1.16 → pywsgiref-1.1.17}/src/PyWSGIRef/beta.py +0 -0
  14. {pywsgiref-1.1.16 → pywsgiref-1.1.17}/src/PyWSGIRef/commons.py +0 -0
  15. {pywsgiref-1.1.16 → pywsgiref-1.1.17}/src/PyWSGIRef/defaults.py +0 -0
  16. {pywsgiref-1.1.16 → pywsgiref-1.1.17}/src/PyWSGIRef/exceptions.py +0 -0
  17. {pywsgiref-1.1.16 → pywsgiref-1.1.17}/src/PyWSGIRef/finished.py +0 -0
  18. {pywsgiref-1.1.16 → pywsgiref-1.1.17}/src/PyWSGIRef/patterns.py +0 -0
  19. {pywsgiref-1.1.16 → pywsgiref-1.1.17}/src/PyWSGIRef/simpleServer.py +0 -0
  20. {pywsgiref-1.1.16 → pywsgiref-1.1.17}/src/PyWSGIRef/stats.py +0 -0
  21. {pywsgiref-1.1.16 → pywsgiref-1.1.17}/src/PyWSGIRef/templateDict.py +0 -0
  22. {pywsgiref-1.1.16 → pywsgiref-1.1.17}/src/PyWSGIRef.egg-info/SOURCES.txt +0 -0
  23. {pywsgiref-1.1.16 → pywsgiref-1.1.17}/src/PyWSGIRef.egg-info/dependency_links.txt +0 -0
  24. {pywsgiref-1.1.16 → pywsgiref-1.1.17}/src/PyWSGIRef.egg-info/requires.txt +0 -0
  25. {pywsgiref-1.1.16 → pywsgiref-1.1.17}/src/PyWSGIRef.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyWSGIRef
3
- Version: 1.1.16
3
+ Version: 1.1.17
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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "PyWSGIRef"
3
- version = "1.1.16"
3
+ version = "1.1.17"
4
4
  authors = [
5
5
  {name="Leander Kafemann", email="leander.kafemann+python@icloud.com" },
6
6
  ]
@@ -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, 16), "Author": "Leander Kafemann", "date": "05.09.2025",\
21
+ return {"Version": (1, 1, 17), "Author": "Leander Kafemann", "date": "02.11.2025",\
22
22
  "recommend": ("pyimager"), "feedbackTo": "leander.kafemann+python@icloud.com"}
23
23
 
24
24
  SCHABLONEN = TemplateDict()
@@ -34,7 +34,8 @@ def addSchablone(name: str, content: str):
34
34
  SCHABLONEN[name] = PyHTML(content)
35
35
 
36
36
  def makeApplicationObject(contentGeneratingFunction: Callable, advanced: bool = False, setAdvancedHeaders: bool = False,\
37
- getIP: bool = False, vercelPythonHosting: bool = False, getStats: bool = False) -> Callable:
37
+ getIP: bool = False, vercelPythonHosting: bool = False, getStats: bool = False,
38
+ customEncoding: bool = False) -> Callable:
38
39
  """
39
40
  Returns a WSGI application object based on your contentGeneratingFunction.
40
41
  The contentGeneratingFunction should take a single argument (the path) and return the content as a string.
@@ -43,6 +44,7 @@ def makeApplicationObject(contentGeneratingFunction: Callable, advanced: bool =
43
44
  If getIP is True, the contentGeneratingFunction will receive the IP address of the client as an additional argument.
44
45
  If vercelPythonHosting is True, your application object will be optimized for Vercel's unusual WSGI methods.
45
46
  If getStats is True, stats are saved in the STATS object (BETA).
47
+ If customEncoding is True, the contentGeneratingFunction has to encode the content itself.
46
48
  Locks BETA mode.
47
49
  """
48
50
  if not callable(contentGeneratingFunction):
@@ -85,6 +87,8 @@ def makeApplicationObject(contentGeneratingFunction: Callable, advanced: bool =
85
87
  if getStats:
86
88
  STATS.stopPerfTime(perfTime)
87
89
  if not vercelPythonHosting:
90
+ if customEncoding:
91
+ return content
88
92
  return [content.encode("utf-8")]
89
93
  return simpleApplication
90
94
 
@@ -6,11 +6,12 @@ import requests
6
6
  from .exceptions import *
7
7
  from .finished import finished
8
8
 
9
- def loadFromWeb(url: str) -> str:
9
+ def loadFromWeb(url: str, overrideException: bool = False) -> str:
10
10
  """
11
11
  Loads content from the given URL with the given data.
12
+ Overrides ServerAlreadyGeneratedError if overrideException is True.
12
13
  """
13
- if finished.value:
14
+ if finished.value and not overrideException:
14
15
  raise ServerAlreadyGeneratedError()
15
16
  if not url.endswith(".pyhtml"):
16
17
  raise InvalidFiletypeError()
@@ -20,7 +20,7 @@ class PyHTML:
20
20
  if self.html.startswith(EVAL_PYHTML):
21
21
  self.html = START_REPLACE + self.html[len(EVAL_PYHTML):]
22
22
  if self.html.endswith(EVAL_PYHTML):
23
- self.html = self.html[:-len(EVAL_PYHTML)-1] + END_REPLACE
23
+ self.html = self.html[:-len(EVAL_PYHTML)] + END_REPLACE
24
24
 
25
25
  def _replace_modern_styling(self):
26
26
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyWSGIRef
3
- Version: 1.1.16
3
+ Version: 1.1.17
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
@@ -0,0 +1,3 @@
1
+ from PyWSGIRef.simpleServer import *
2
+
3
+ main()
@@ -1,3 +0,0 @@
1
- from PyWSGIRef import *
2
-
3
- main()
File without changes
File without changes
File without changes