tina4-python 0.2.150__tar.gz → 0.2.152__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.
- {tina4_python-0.2.150 → tina4_python-0.2.152}/PKG-INFO +1 -1
- {tina4_python-0.2.150 → tina4_python-0.2.152}/pyproject.toml +1 -1
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/Template.py +5 -6
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/__init__.py +6 -6
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/cli.py +5 -5
- {tina4_python-0.2.150 → tina4_python-0.2.152}/.gitignore +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/README.md +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/Api.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/Auth.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/CRUD.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/Constant.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/Database.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/DatabaseResult.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/DatabaseTypes.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/Debug.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/Env.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/FieldTypes.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/HtmlElement.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/Localization.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/Messages.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/MiddleWare.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/Migration.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/ORM.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/Queue.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/Request.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/Response.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/Router.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/Session.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/ShellColors.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/Swagger.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/Testing.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/WSDL.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/Webserver.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/Websocket.py +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/messages.pot +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/public/css/readme.md +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/public/favicon.ico +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/public/images/403.png +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/public/images/404.png +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/public/images/500.png +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/public/images/logo.png +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/public/images/readme.md +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/public/js/readme.md +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/public/js/reconnecting-websocket.js +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/public/js/tina4helper.js +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/public/swagger/index.html +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/public/swagger/oauth2-redirect.html +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/templates/components/crud.twig +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/templates/errors/403.twig +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/templates/errors/404.twig +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/templates/errors/500.twig +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/templates/readme.md +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/translations/en/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/translations/en/LC_MESSAGES/messages.po +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/translations/fr/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/translations/fr/LC_MESSAGES/messages.po +0 -0
|
@@ -146,10 +146,11 @@ class Template:
|
|
|
146
146
|
|
|
147
147
|
twig = Template.init_twig(tina4_python.root_path + os.sep + "src" + os.sep + "templates")
|
|
148
148
|
try:
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
149
|
+
try:
|
|
150
|
+
if twig.get_template(template_or_file_name):
|
|
151
|
+
template = twig.get_template(template_or_file_name)
|
|
152
|
+
content = template.render(data)
|
|
153
|
+
except:
|
|
153
154
|
template = twig.from_string(template_or_file_name)
|
|
154
155
|
content = template.render(data)
|
|
155
156
|
|
|
@@ -207,8 +208,6 @@ class Template:
|
|
|
207
208
|
return {"content": content, "content_type": mime_type}
|
|
208
209
|
except json.JSONDecodeError as e:
|
|
209
210
|
return {"content": str(e), "content_type": ""}
|
|
210
|
-
|
|
211
|
-
|
|
212
211
|
mime_type = "jpeg"
|
|
213
212
|
# Check magic bytes on value
|
|
214
213
|
if value[:4] == '/9j/':
|
|
@@ -137,8 +137,7 @@ def global_exception_handler(exception):
|
|
|
137
137
|
tb_str = ''.join(traceback.format_exception(None, exception, exception.__traceback__))
|
|
138
138
|
error_string = "Exception Error: " + error + "\n" + tb_str + "\nYou are seeing this error because Tina4 is in debug mode"
|
|
139
139
|
Debug.error(error_string)
|
|
140
|
-
if
|
|
141
|
-
or debug_level in os.getenv("TINA4_DEBUG_LEVEL", [Constant.TINA4_LOG_ALL])):
|
|
140
|
+
if debug_level == "ALL" or debug_level is None or debug_level == "DEBUG":
|
|
142
141
|
pass
|
|
143
142
|
else:
|
|
144
143
|
error_string = "An exception happened"
|
|
@@ -428,6 +427,11 @@ async def app(scope, receive, send):
|
|
|
428
427
|
'type': 'http.response.body',
|
|
429
428
|
'body': tina4_response.content,
|
|
430
429
|
})
|
|
430
|
+
else:
|
|
431
|
+
if message["type"] == "websocket" and tina4_response.http_code != 200:
|
|
432
|
+
await send({
|
|
433
|
+
'type': 'websocket.close',
|
|
434
|
+
})
|
|
431
435
|
|
|
432
436
|
|
|
433
437
|
def run_web_server(hostname="localhost", port=7145, debug: bool = False):
|
|
@@ -532,10 +536,6 @@ def webserver(host_name, port, debug: bool = False):
|
|
|
532
536
|
|
|
533
537
|
Debug.info(Messages.MSG_SERVER_STOPPED)
|
|
534
538
|
|
|
535
|
-
Debug.info(Messages.MSG_SERVER_STOPPED)
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
539
|
# Live coding hot-reload (jurigged)
|
|
540
540
|
if importlib.util.find_spec("jurigged"):
|
|
541
541
|
Debug.debug("Jurigged enabled")
|
|
@@ -65,7 +65,7 @@ async def index(request, response):
|
|
|
65
65
|
return response(f"OK")
|
|
66
66
|
|
|
67
67
|
if __name__ == "__main__":
|
|
68
|
-
run_web_server()
|
|
68
|
+
run_web_server("0.0.0.0", 7145)
|
|
69
69
|
'''
|
|
70
70
|
app_py.write_text(app_content, encoding="utf-8")
|
|
71
71
|
|
|
@@ -143,7 +143,7 @@ COPY --from=builder /usr/local/bin /usr/local/bin
|
|
|
143
143
|
# Copy application code
|
|
144
144
|
COPY --from=builder /app /app
|
|
145
145
|
|
|
146
|
-
EXPOSE
|
|
146
|
+
EXPOSE 7145
|
|
147
147
|
|
|
148
148
|
# Swagger defaults (override with env vars in docker-compose/k8s if needed)
|
|
149
149
|
ENV SWAGGER_TITLE="Tina4 API"
|
|
@@ -151,7 +151,7 @@ ENV SWAGGER_VERSION="0.1.0"
|
|
|
151
151
|
ENV SWAGGER_DESCRIPTION="Auto-generated API documentation"
|
|
152
152
|
|
|
153
153
|
# Start the server on all interfaces
|
|
154
|
-
CMD ["python3", "app.py", "0.0.0.0:
|
|
154
|
+
CMD ["python3", "app.py", "0.0.0.0:7145", "-u"]
|
|
155
155
|
'''
|
|
156
156
|
dockerfile_path.write_text(dockerfile_content, encoding="utf-8")
|
|
157
157
|
print("Dockerfile created (multi-stage + uv)")
|
|
@@ -164,11 +164,11 @@ CMD ["python3", "app.py", "0.0.0.0:8080", "-u"]
|
|
|
164
164
|
print(f"\nNext steps:")
|
|
165
165
|
print(f" cd {project_path.relative_to(Path.cwd())}")
|
|
166
166
|
print(f" python app.py # local development")
|
|
167
|
-
print(f" docker build -t {project_path.name} . && docker run -p
|
|
167
|
+
print(f" docker build -t {project_path.name} . && docker run -p 7145:7145 {project_path.name}")
|
|
168
168
|
else:
|
|
169
169
|
print("\nYou are already in the project folder. Run:")
|
|
170
170
|
print(" python app.py # development")
|
|
171
|
-
print(" docker build -t myapp . && docker run -p
|
|
171
|
+
print(" docker build -t myapp . && docker run -p 7145:7145 myapp")
|
|
172
172
|
|
|
173
173
|
|
|
174
174
|
def run_server(port: int = 8000):
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/public/js/reconnecting-websocket.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/public/swagger/oauth2-redirect.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/translations/en/LC_MESSAGES/messages.mo
RENAMED
|
File without changes
|
{tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/translations/en/LC_MESSAGES/messages.po
RENAMED
|
File without changes
|
{tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/translations/fr/LC_MESSAGES/messages.mo
RENAMED
|
File without changes
|
{tina4_python-0.2.150 → tina4_python-0.2.152}/tina4_python/translations/fr/LC_MESSAGES/messages.po
RENAMED
|
File without changes
|