@@ -18,7 +18,7 @@ def about():
1818 """
1919 Returns information about your release and other projects by Leander Kafemann
2020 """
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" ,\
2222 "recommend" : (
"pyimager" ),
"feedbackTo" :
"[email protected] " }
2323
2424SCHABLONEN = TemplateDict ()
@@ -34,7 +34,8 @@ def addSchablone(name: str, content: str):
3434 SCHABLONEN [name ] = PyHTML (content )
3535
3636def 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 :
3839 """
3940 Returns a WSGI application object based on your contentGeneratingFunction.
4041 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 =
4344 If getIP is True, the contentGeneratingFunction will receive the IP address of the client as an additional argument.
4445 If vercelPythonHosting is True, your application object will be optimized for Vercel's unusual WSGI methods.
4546 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.
4648 Locks BETA mode.
4749 """
4850 if not callable (contentGeneratingFunction ):
@@ -85,6 +87,8 @@ def simpleApplication(environ, start_response) -> list:
8587 if getStats :
8688 STATS .stopPerfTime (perfTime )
8789 if not vercelPythonHosting :
90+ if customEncoding :
91+ return content
8892 return [content .encode ("utf-8" )]
8993 return simpleApplication
9094
0 commit comments