tina4-python 3.13.163__tar.gz → 3.13.164__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-3.13.163 → tina4_python-3.13.164}/PKG-INFO +9 -9
- {tina4_python-3.13.163 → tina4_python-3.13.164}/pyproject.toml +9 -9
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/__init__.py +1 -1
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/ai/__init__.py +2 -2
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/cli/__init__.py +7 -3
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/core/port_takeover.py +53 -12
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/core/response.py +6 -2
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/core/server.py +34 -3
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/dev_admin/__init__.py +27 -9
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/frond/engine.py +60 -19
- {tina4_python-3.13.163 → tina4_python-3.13.164}/.gitignore +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/COMMERCIAL-LICENSE.md +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/LICENSE +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/NOTICE +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/README.md +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/.tina4-metrics.json +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/CLAUDE.md +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/HtmlElement.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/Testing.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/_import_helper.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/_testing_async.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/ai/client.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/api/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/auth/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/cache/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/container/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/context/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/context/chunker.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/core/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/core/cache.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/core/constants.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/core/csp.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/core/events.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/core/middleware.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/core/rate_limiter.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/core/request.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/core/router.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/crud/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/crud/page.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/crud/page_render.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/database/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/database/adapter.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/database/async_api.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/database/connection.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/database/database_url.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/database/firebird.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/database/mongodb.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/database/mssql.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/database/mysql.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/database/odbc.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/database/pool.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/database/postgres.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/database/sql_translator.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/database/sqlite.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/debug/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/debug/error_overlay.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/dev_admin/metrics.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/dev_admin/plan.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/dev_admin/project_index.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/docs.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/docstore/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/dotenv/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/env.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/frond/FROND.md +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/frond/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/frond/compiler.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/frond/parser.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/gallery/auth/meta.json +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/gallery/auth/src/routes/api/gallery_auth.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/gallery/database/meta.json +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/gallery/database/src/routes/api/gallery_db.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/gallery/error-overlay/meta.json +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/gallery/error-overlay/src/routes/api/gallery_crash.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/gallery/orm/meta.json +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/gallery/orm/src/orm/Product.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/gallery/orm/src/routes/api/gallery_products.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/gallery/queue/meta.json +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/gallery/queue/src/routes/api/gallery_queue.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/gallery/rest-api/meta.json +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/gallery/rest-api/src/routes/api/gallery_hello.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/gallery/templates/meta.json +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/gallery/templates/src/routes/gallery_page.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/gallery/templates/src/templates/gallery_page.twig +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/graph/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/graph/adapter.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/graph/adapters/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/graph/adapters/arango.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/graph/adapters/bolt.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/graph/adapters/ultipa.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/graph/graph_url.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/graphql/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/i18n/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/mcp/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/mcp/protocol.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/mcp/tools.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/messenger/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/migration/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/migration/runner.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/mqtt/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/mqtt/message.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/orm/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/orm/async_api.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/orm/collection.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/orm/fields.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/orm/model.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/orm/point.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/THIRD-PARTY-NOTICES.md +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/__feedback/widget.js +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/bundled-component-provenance.json +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/css/tina4.css +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/css/tina4.min.css +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/favicon.ico +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/images/logo.svg +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/images/tina4-logo-icon.webp +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/js/frond.js +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/js/frond.min.js +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/js/tina4-dev-admin-split.html +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/js/tina4-dev-admin.min.js +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/js/tina4.min.js +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/js/tina4js.min.js +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/licenses/swagger-ui-3.10.0-original-notice.txt +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/licenses/swagger-ui-5.17.14-NOTICE.txt +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/licenses/swagger-ui-Apache-2.0.txt +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/licenses/tina4-css-MIT.txt +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/licenses/tina4-dev-admin-components.json +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/licenses/tina4-dev-admin-third-party.txt +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/licenses/tina4-js-MIT.txt +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/swagger/index.html +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/public/swagger/oauth2-redirect.html +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/push/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/push/_base.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/push/_cryptography.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/push/_libcrypto.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/query_builder/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/queue/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/queue/amqp_url.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/queue/job.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/queue/kafka_backend.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/queue/lite_backend.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/queue/mongo_backend.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/queue/rabbitmq_backend.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/queue/topic_dead_letter.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/queue_backends/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/queue_backends/kafka_backend.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/queue_backends/mongo_backend.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/queue_backends/rabbitmq_backend.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/realtime/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/realtime/models/Attachment.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/realtime/models/Channel.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/realtime/models/ChannelMember.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/realtime/models/Message.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/realtime/models/Workspace.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/realtime/models/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/realtime/s3_client.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/realtime/storage.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/seeder/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/service/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/session/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/session_handlers/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/session_handlers/memcached_handler.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/session_handlers/mongodb_handler.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/session_handlers/redis_handler.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/session_handlers/valkey_handler.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/sso.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/ssrf.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/swagger/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/tcp/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/templates/components/crud.twig +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/templates/crud/form.twig +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/templates/crud/modals.twig +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/templates/crud/page.twig +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/templates/crud/table.twig +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/templates/docker/distroless/Dockerfile +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/templates/docker/poetry/Dockerfile +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/templates/docker/python/Dockerfile +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/templates/docker/uv/Dockerfile +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/templates/errors/302.twig +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/templates/errors/401.twig +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/templates/errors/403.twig +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/templates/errors/404.twig +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/templates/errors/500.twig +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/templates/errors/502.twig +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/templates/errors/503.twig +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/templates/errors/base.twig +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/templates/frontend/README.md +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/templates/readme.md +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/test/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/test_client/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/translations/af/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/translations/af/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/translations/en/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/translations/en/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/translations/es/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/translations/es/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/translations/fr/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/translations/fr/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/translations/ja/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/translations/ja/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/translations/zh/LC_MESSAGES/messages.mo +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/translations/zh/LC_MESSAGES/messages.po +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/validator/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/websocket/__init__.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/websocket/backplane.py +0 -0
- {tina4_python-3.13.163 → tina4_python-3.13.164}/tina4_python/wsdl/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: tina4-python
|
|
3
|
-
Version: 3.13.
|
|
3
|
+
Version: 3.13.164
|
|
4
4
|
Summary: Tina4 Python v3 — Zero-dependency, lightweight web framework
|
|
5
5
|
Author-email: Andre van Zuydam <andrevanzuydam@gmail.com>
|
|
6
6
|
License-Expression: MPL-2.0
|
|
@@ -10,9 +10,9 @@ License-File: NOTICE
|
|
|
10
10
|
Requires-Python: >=3.12
|
|
11
11
|
Provides-Extra: all-db
|
|
12
12
|
Requires-Dist: firebird-driver>=1.10; extra == 'all-db'
|
|
13
|
-
Requires-Dist: mysql-connector-python>=9.0; extra == 'all-db'
|
|
13
|
+
Requires-Dist: mysql-connector-python>=9.1.0; extra == 'all-db'
|
|
14
14
|
Requires-Dist: psycopg2-binary>=2.9; extra == 'all-db'
|
|
15
|
-
Requires-Dist: pymongo>=4.18.
|
|
15
|
+
Requires-Dist: pymongo>=4.18.3; extra == 'all-db'
|
|
16
16
|
Requires-Dist: pymssql>=2.3; extra == 'all-db'
|
|
17
17
|
Requires-Dist: pyodbc>=5.0; extra == 'all-db'
|
|
18
18
|
Provides-Extra: arango
|
|
@@ -29,11 +29,11 @@ Requires-Dist: confluent-kafka>=2.0; extra == 'kafka'
|
|
|
29
29
|
Provides-Extra: memcache
|
|
30
30
|
Requires-Dist: pymemcache>=4.0; extra == 'memcache'
|
|
31
31
|
Provides-Extra: mongo
|
|
32
|
-
Requires-Dist: pymongo>=4.18.
|
|
32
|
+
Requires-Dist: pymongo>=4.18.3; extra == 'mongo'
|
|
33
33
|
Provides-Extra: mssql
|
|
34
34
|
Requires-Dist: pymssql>=2.3; extra == 'mssql'
|
|
35
35
|
Provides-Extra: mysql
|
|
36
|
-
Requires-Dist: mysql-connector-python>=9.0; extra == 'mysql'
|
|
36
|
+
Requires-Dist: mysql-connector-python>=9.1.0; extra == 'mysql'
|
|
37
37
|
Provides-Extra: neo4j
|
|
38
38
|
Requires-Dist: neo4j>=5.0; extra == 'neo4j'
|
|
39
39
|
Provides-Extra: odbc
|
|
@@ -41,7 +41,7 @@ Requires-Dist: pyodbc>=5.0; extra == 'odbc'
|
|
|
41
41
|
Provides-Extra: postgres
|
|
42
42
|
Requires-Dist: psycopg2-binary>=2.9; extra == 'postgres'
|
|
43
43
|
Provides-Extra: push
|
|
44
|
-
Requires-Dist: cryptography>=
|
|
44
|
+
Requires-Dist: cryptography>=50.0.0; extra == 'push'
|
|
45
45
|
Provides-Extra: rabbitmq
|
|
46
46
|
Requires-Dist: pika>=1.3; extra == 'rabbitmq'
|
|
47
47
|
Provides-Extra: redis
|
|
@@ -49,14 +49,14 @@ Requires-Dist: redis>=5.0; extra == 'redis'
|
|
|
49
49
|
Provides-Extra: s3
|
|
50
50
|
Provides-Extra: test
|
|
51
51
|
Requires-Dist: confluent-kafka>=2.0; extra == 'test'
|
|
52
|
-
Requires-Dist: cryptography>=
|
|
52
|
+
Requires-Dist: cryptography>=50.0.0; extra == 'test'
|
|
53
53
|
Requires-Dist: firebird-driver>=1.10; extra == 'test'
|
|
54
|
-
Requires-Dist: mysql-connector-python>=9.0; extra == 'test'
|
|
54
|
+
Requires-Dist: mysql-connector-python>=9.1.0; extra == 'test'
|
|
55
55
|
Requires-Dist: openapi-spec-validator>=0.7; extra == 'test'
|
|
56
56
|
Requires-Dist: pika>=1.3; extra == 'test'
|
|
57
57
|
Requires-Dist: psycopg2-binary>=2.9; extra == 'test'
|
|
58
58
|
Requires-Dist: pymemcache>=4.0; extra == 'test'
|
|
59
|
-
Requires-Dist: pymongo>=4.18.
|
|
59
|
+
Requires-Dist: pymongo>=4.18.3; extra == 'test'
|
|
60
60
|
Requires-Dist: pymssql>=2.3; extra == 'test'
|
|
61
61
|
Requires-Dist: pyodbc>=5.0; extra == 'test'
|
|
62
62
|
Requires-Dist: redis>=5.0; extra == 'test'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "tina4-python"
|
|
3
|
-
version = "3.13.
|
|
3
|
+
version = "3.13.164"
|
|
4
4
|
description = "Tina4 Python v3 — Zero-dependency, lightweight web framework"
|
|
5
5
|
authors = [
|
|
6
6
|
{name = "Andre van Zuydam", email = "andrevanzuydam@gmail.com"}
|
|
@@ -16,10 +16,10 @@ dependencies = []
|
|
|
16
16
|
[project.optional-dependencies]
|
|
17
17
|
# Database drivers — install what you need
|
|
18
18
|
postgres = ["psycopg2-binary>=2.9"]
|
|
19
|
-
mysql = ["mysql-connector-python>=9.0"]
|
|
19
|
+
mysql = ["mysql-connector-python>=9.1.0"]
|
|
20
20
|
mssql = ["pymssql>=2.3"]
|
|
21
21
|
firebird = ["firebird-driver>=1.10"]
|
|
22
|
-
mongo = ["pymongo>=4.18.
|
|
22
|
+
mongo = ["pymongo>=4.18.3"]
|
|
23
23
|
odbc = ["pyodbc>=5.0"]
|
|
24
24
|
|
|
25
25
|
# Graph engine drivers — install what you need (loaded lazily on first use).
|
|
@@ -51,15 +51,15 @@ rabbitmq = ["pika>=1.3"]
|
|
|
51
51
|
# cannot reach a safe OpenSSL, so the cryptography package runs instead. Install
|
|
52
52
|
# it there (or pin it with TINA4_PUSH_BACKEND=cryptography); the wire output is
|
|
53
53
|
# identical either way. See tina4_python/push/_libcrypto.py.
|
|
54
|
-
push = ["cryptography>=
|
|
54
|
+
push = ["cryptography>=50.0.0"]
|
|
55
55
|
|
|
56
56
|
# All database drivers
|
|
57
57
|
all-db = [
|
|
58
58
|
"psycopg2-binary>=2.9",
|
|
59
|
-
"mysql-connector-python>=9.0",
|
|
59
|
+
"mysql-connector-python>=9.1.0",
|
|
60
60
|
"pymssql>=2.3",
|
|
61
61
|
"firebird-driver>=1.10",
|
|
62
|
-
"pymongo>=4.18.
|
|
62
|
+
"pymongo>=4.18.3",
|
|
63
63
|
"pyodbc>=5.0",
|
|
64
64
|
]
|
|
65
65
|
|
|
@@ -85,10 +85,10 @@ all-db = [
|
|
|
85
85
|
# the urllib3 advisories they carried.
|
|
86
86
|
test = [
|
|
87
87
|
"psycopg2-binary>=2.9",
|
|
88
|
-
"mysql-connector-python>=9.0",
|
|
88
|
+
"mysql-connector-python>=9.1.0",
|
|
89
89
|
"pymssql>=2.3",
|
|
90
90
|
"firebird-driver>=1.10",
|
|
91
|
-
"pymongo>=4.18.
|
|
91
|
+
"pymongo>=4.18.3",
|
|
92
92
|
"pyodbc>=5.0",
|
|
93
93
|
"redis>=5.0",
|
|
94
94
|
"pymemcache>=4.0",
|
|
@@ -99,7 +99,7 @@ test = [
|
|
|
99
99
|
# runtime dependency — the swagger generator itself stays zero-dependency.
|
|
100
100
|
"openapi-spec-validator>=0.7",
|
|
101
101
|
# TEST-ONLY: exercises Feature 140's optional native crypto capability.
|
|
102
|
-
"cryptography>=
|
|
102
|
+
"cryptography>=50.0.0",
|
|
103
103
|
]
|
|
104
104
|
|
|
105
105
|
[dependency-groups]
|
|
@@ -497,8 +497,8 @@ def generate_context(tool_name: str = "claude-code") -> str:
|
|
|
497
497
|
async def list_users(request, response):
|
|
498
498
|
return response({"users": []})
|
|
499
499
|
|
|
500
|
-
@post("/api/users")
|
|
501
500
|
@noauth()
|
|
501
|
+
@post("/api/users")
|
|
502
502
|
async def create_user(request, response):
|
|
503
503
|
return response({"created": request.body["name"]}, 201)'''
|
|
504
504
|
|
|
@@ -719,7 +719,7 @@ This project uses Tina4 Python. All features are built in — do not install ext
|
|
|
719
719
|
## CLI
|
|
720
720
|
|
|
721
721
|
```bash
|
|
722
|
-
tina4python serve # Dev server on port
|
|
722
|
+
tina4python serve # Dev server on port 7146
|
|
723
723
|
tina4python migrate # Run migrations
|
|
724
724
|
tina4python test # Run tests
|
|
725
725
|
tina4python routes # List routes
|
|
@@ -288,7 +288,7 @@ from tina4_python.core.port_takeover import ( # noqa: E402
|
|
|
288
288
|
)
|
|
289
289
|
|
|
290
290
|
|
|
291
|
-
def _kill_process_on_port(port: int) -> bool:
|
|
291
|
+
def _kill_process_on_port(port: int, host: str | None = None) -> bool:
|
|
292
292
|
"""Reclaim *port* from a stale Tina4 dev server, only when it is safe.
|
|
293
293
|
|
|
294
294
|
Routes through the shared identity-checked takeover (TAKEOVER-DEC-01/02):
|
|
@@ -297,9 +297,12 @@ def _kill_process_on_port(port: int) -> bool:
|
|
|
297
297
|
printed; takeover is also skipped in a container, outside dev mode, and when
|
|
298
298
|
opted out (`TINA4_NO_TAKEOVER` / `tina4 serve --no-kill`).
|
|
299
299
|
|
|
300
|
+
*host* is the address serve will bind; when given, a port that binds there
|
|
301
|
+
is reported as free instead of "in use".
|
|
302
|
+
|
|
300
303
|
Returns True only when a Tina4 holder was actually signalled.
|
|
301
304
|
"""
|
|
302
|
-
result = take_over_port(port, dev=is_dev(), no_takeover=no_takeover_opted_out())
|
|
305
|
+
result = take_over_port(port, dev=is_dev(), no_takeover=no_takeover_opted_out(), host=host)
|
|
303
306
|
if result.reclaimed:
|
|
304
307
|
print(f" ⚠ {result.message}")
|
|
305
308
|
return True
|
|
@@ -864,7 +867,8 @@ def _serve(args):
|
|
|
864
867
|
|
|
865
868
|
# Reclaim the port from a stale Tina4 dev server only (identity-checked).
|
|
866
869
|
port = cli_port or int(os.environ.get("PORT", os.environ.get("TINA4_PORT", "7146")))
|
|
867
|
-
|
|
870
|
+
from tina4_python.core.server import resolve_config
|
|
871
|
+
_kill_process_on_port(port, host=resolve_config(cli_host=cli_host, cli_port=port)[0])
|
|
868
872
|
|
|
869
873
|
from tina4_python.core import run
|
|
870
874
|
run(host=cli_host, port=cli_port, no_browser=no_browser, no_reload=no_reload)
|
|
@@ -44,6 +44,7 @@ from __future__ import annotations
|
|
|
44
44
|
|
|
45
45
|
import os
|
|
46
46
|
import signal
|
|
47
|
+
import socket
|
|
47
48
|
import subprocess
|
|
48
49
|
import sys
|
|
49
50
|
from dataclasses import dataclass, field
|
|
@@ -233,6 +234,49 @@ def _port_holders(port: int) -> list[str]:
|
|
|
233
234
|
return []
|
|
234
235
|
|
|
235
236
|
|
|
237
|
+
def _bindable(host: str, port: int) -> bool:
|
|
238
|
+
"""True when a plain TCP listener on *host*:*port* binds right now.
|
|
239
|
+
|
|
240
|
+
SO_REUSEADDR off Windows only, as the server's own bind does: on POSIX it
|
|
241
|
+
lets a TIME_WAIT leftover pass but still fails against a live listener;
|
|
242
|
+
on Windows it would let the probe bind over a live listener.
|
|
243
|
+
"""
|
|
244
|
+
family = socket.AF_INET6 if ":" in host else socket.AF_INET
|
|
245
|
+
try:
|
|
246
|
+
with socket.socket(family, socket.SOCK_STREAM) as probe:
|
|
247
|
+
if sys.platform != "win32":
|
|
248
|
+
probe.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
|
249
|
+
probe.bind((host.strip("[]"), port))
|
|
250
|
+
probe.listen(1)
|
|
251
|
+
except (OSError, ValueError, OverflowError):
|
|
252
|
+
return False
|
|
253
|
+
return True
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
def _refusal(port: int, dev: bool, no_takeover: bool, host: str | None) -> TakeoverResult | None:
|
|
257
|
+
"""The result to return before any holder lookup, or None to carry on.
|
|
258
|
+
|
|
259
|
+
Takeover is refused when opted out or outside dev mode. Before a bind, the
|
|
260
|
+
caller passes the host it will bind: if that bind succeeds, nothing holds
|
|
261
|
+
the port, so there is nothing to refuse and nothing to say.
|
|
262
|
+
"""
|
|
263
|
+
if dev and not no_takeover:
|
|
264
|
+
return None
|
|
265
|
+
if host is not None and _bindable(host, port):
|
|
266
|
+
return TakeoverResult(NOTHING, port)
|
|
267
|
+
if no_takeover:
|
|
268
|
+
return TakeoverResult(
|
|
269
|
+
REFUSED_OPTOUT, port,
|
|
270
|
+
message=(f"Port {port} is in use and takeover is disabled "
|
|
271
|
+
f"(TINA4_NO_TAKEOVER/--no-kill) -- free it or choose another port."),
|
|
272
|
+
)
|
|
273
|
+
return TakeoverResult(
|
|
274
|
+
REFUSED_PROD, port,
|
|
275
|
+
message=(f"Port {port} is in use; takeover is disabled outside dev mode "
|
|
276
|
+
f"-- free it or choose another port."),
|
|
277
|
+
)
|
|
278
|
+
|
|
279
|
+
|
|
236
280
|
# ── the ONE takeover entry point (CLI + runtime both call this) ────────────
|
|
237
281
|
|
|
238
282
|
def take_over_port(
|
|
@@ -242,6 +286,7 @@ def take_over_port(
|
|
|
242
286
|
no_takeover: bool,
|
|
243
287
|
base_dir: str | None = None,
|
|
244
288
|
grace: float = 0.5,
|
|
289
|
+
host: str | None = None,
|
|
245
290
|
) -> TakeoverResult:
|
|
246
291
|
"""Reclaim *port* ONLY from an identity-confirmed Tina4 dev server.
|
|
247
292
|
|
|
@@ -257,19 +302,15 @@ def take_over_port(
|
|
|
257
302
|
|
|
258
303
|
``dev`` and ``no_takeover`` are passed in so this stays pure and directly
|
|
259
304
|
testable; the callers resolve them from :func:`is_dev` / :func:`no_takeover_opted_out`.
|
|
305
|
+
|
|
306
|
+
Before a bind, the caller passes the ``host`` it will bind. When takeover
|
|
307
|
+
would be refused and that bind succeeds, nothing holds the port: there is
|
|
308
|
+
nothing to refuse and nothing to say (NOTHING, no message). Without it, every
|
|
309
|
+
start with debug off or ``--no-kill`` said a free port was in use.
|
|
260
310
|
"""
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
message=(f"Port {port} is in use and takeover is disabled "
|
|
265
|
-
f"(TINA4_NO_TAKEOVER/--no-kill) -- free it or choose another port."),
|
|
266
|
-
)
|
|
267
|
-
if not dev:
|
|
268
|
-
return TakeoverResult(
|
|
269
|
-
REFUSED_PROD, port,
|
|
270
|
-
message=(f"Port {port} is in use; takeover is disabled outside dev mode "
|
|
271
|
-
f"-- free it or choose another port."),
|
|
272
|
-
)
|
|
311
|
+
early = _refusal(port, dev, no_takeover, host)
|
|
312
|
+
if early is not None:
|
|
313
|
+
return early
|
|
273
314
|
if in_container():
|
|
274
315
|
return TakeoverResult(SKIPPED_CONTAINER, port)
|
|
275
316
|
|
|
@@ -87,8 +87,12 @@ def get_framework_frond():
|
|
|
87
87
|
# Sync custom filters/globals from the user engine
|
|
88
88
|
if _framework_frond is not None:
|
|
89
89
|
user_engine = get_frond()
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
# Instance filters only: class filters already reach every engine.
|
|
91
|
+
for name, fn in user_engine._local_filters.items():
|
|
92
|
+
_framework_frond.add_filter(name, fn)
|
|
93
|
+
# Only the user engine's own (instance) globals: class globals are
|
|
94
|
+
# already live on every engine, so copying them would freeze them.
|
|
95
|
+
_framework_frond._globals.maps[0].update(user_engine._globals.maps[0])
|
|
92
96
|
return _framework_frond
|
|
93
97
|
|
|
94
98
|
|
|
@@ -670,9 +670,17 @@ def _auto_wire_i18n():
|
|
|
670
670
|
default_locale=os.environ.get("TINA4_LOCALE", "en"),
|
|
671
671
|
)
|
|
672
672
|
|
|
673
|
-
#
|
|
673
|
+
# Templates call t("key") or t("key", {"name": n}): Frond passes a
|
|
674
|
+
# params map positionally, and I18n.t takes keyword placeholders, so
|
|
675
|
+
# the template global accepts both shapes and merges them.
|
|
676
|
+
def _template_t(key, params=None, **kwargs):
|
|
677
|
+
return i18n.t(key, **{**(params or {}), **kwargs})
|
|
678
|
+
|
|
679
|
+
# Only register if t() hasn't been explicitly set by the user. A class
|
|
680
|
+
# registration reaches every engine, response.render's included,
|
|
681
|
+
# whenever it is made.
|
|
674
682
|
if "t" not in Frond._class_globals:
|
|
675
|
-
Frond.
|
|
683
|
+
Frond.add_global("t", _template_t)
|
|
676
684
|
Log.info(f"i18n: auto-registered t() with {len(json_files)} locale(s)")
|
|
677
685
|
except Exception as e:
|
|
678
686
|
Log.error(f"i18n: auto-wire failed: {e}")
|
|
@@ -4239,6 +4247,15 @@ def _check_legacy_env_vars() -> None:
|
|
|
4239
4247
|
sys.exit(2)
|
|
4240
4248
|
|
|
4241
4249
|
|
|
4250
|
+
_URL_USERINFO = re.compile(r"://[^/\s@]*@")
|
|
4251
|
+
|
|
4252
|
+
|
|
4253
|
+
def _strip_url_credentials(text: str) -> str:
|
|
4254
|
+
"""``text`` with every URL's ``user:pass@`` removed - safe for a boot log."""
|
|
4255
|
+
from tina4_python.database.database_url import redact_url
|
|
4256
|
+
return _URL_USERINFO.sub("://", redact_url(text))
|
|
4257
|
+
|
|
4258
|
+
|
|
4242
4259
|
def _auto_migrate_on_startup(migration_folder: str = "migrations") -> None:
|
|
4243
4260
|
"""Apply pending DB migrations on startup — NON-BREAKING.
|
|
4244
4261
|
|
|
@@ -4267,11 +4284,25 @@ def _auto_migrate_on_startup(migration_folder: str = "migrations") -> None:
|
|
|
4267
4284
|
Log.debug("TINA4_AUTO_MIGRATE is off — skipping startup migrations")
|
|
4268
4285
|
return
|
|
4269
4286
|
|
|
4287
|
+
configured_url = os.environ.get("TINA4_DATABASE_URL", "").strip()
|
|
4270
4288
|
try:
|
|
4271
4289
|
from tina4_python.database import Database
|
|
4272
4290
|
db = Database() # resolves TINA4_DATABASE_URL (framework default if unset)
|
|
4273
4291
|
except Exception as exc:
|
|
4274
|
-
|
|
4292
|
+
# Only an unset TINA4_DATABASE_URL is "no database configured". A set
|
|
4293
|
+
# but unreachable one must say so, or the operator chases a missing
|
|
4294
|
+
# setting that is in fact present (review of tina4-ruby#172).
|
|
4295
|
+
if configured_url:
|
|
4296
|
+
Log.debug(
|
|
4297
|
+
"Startup migrations skipped (database configured but could not "
|
|
4298
|
+
f"connect to {_strip_url_credentials(configured_url)}): "
|
|
4299
|
+
f"{_strip_url_credentials(str(exc))}"
|
|
4300
|
+
)
|
|
4301
|
+
else:
|
|
4302
|
+
Log.debug(
|
|
4303
|
+
"Startup migrations skipped (no database configured): "
|
|
4304
|
+
f"{_strip_url_credentials(str(exc))}"
|
|
4305
|
+
)
|
|
4275
4306
|
return
|
|
4276
4307
|
|
|
4277
4308
|
try:
|
|
@@ -742,6 +742,26 @@ def _peak_rss_mb() -> float:
|
|
|
742
742
|
return round(peak / divisor, 2)
|
|
743
743
|
|
|
744
744
|
|
|
745
|
+
def _current_rss_mb() -> float:
|
|
746
|
+
"""Current resident set size of this process, in MB.
|
|
747
|
+
|
|
748
|
+
From psutil when it is installed, else from ``VmRSS`` in
|
|
749
|
+
``/proc/self/status`` (kilobytes; Linux and Android). Raises (OSError
|
|
750
|
+
where there is no /proc) when neither can be read, e.g. macOS or Windows
|
|
751
|
+
without psutil. Never the peak.
|
|
752
|
+
"""
|
|
753
|
+
try:
|
|
754
|
+
import psutil # optional
|
|
755
|
+
return round(psutil.Process().memory_info().rss / 1024.0 / 1024.0, 2)
|
|
756
|
+
except Exception:
|
|
757
|
+
pass
|
|
758
|
+
with open("/proc/self/status") as fh:
|
|
759
|
+
for line in fh:
|
|
760
|
+
if line.startswith("VmRSS:"):
|
|
761
|
+
return round(int(line.split()[1]) / 1024.0, 2)
|
|
762
|
+
raise OSError("no VmRSS line in /proc/self/status")
|
|
763
|
+
|
|
764
|
+
|
|
745
765
|
async def _api_status(request, response):
|
|
746
766
|
"""System status overview."""
|
|
747
767
|
import sys
|
|
@@ -756,19 +776,17 @@ async def _api_status(request, response):
|
|
|
756
776
|
db_table_count = len(db.get_tables())
|
|
757
777
|
except Exception:
|
|
758
778
|
pass
|
|
759
|
-
# Memory telemetry —
|
|
760
|
-
#
|
|
779
|
+
# Memory telemetry — peak via resource (POSIX), current via psutil or
|
|
780
|
+
# /proc. A figure that cannot be measured stays 0.0 so the key shape is
|
|
781
|
+
# stable; the peak is never reported as current usage.
|
|
761
782
|
memory_usage_mb = 0.0
|
|
762
783
|
peak_memory_mb = 0.0
|
|
763
784
|
try:
|
|
764
785
|
peak_memory_mb = _peak_rss_mb()
|
|
765
|
-
memory_usage_mb = peak_memory_mb # resource has no current-rss field
|
|
766
786
|
except Exception:
|
|
767
787
|
pass
|
|
768
788
|
try:
|
|
769
|
-
|
|
770
|
-
proc = psutil.Process()
|
|
771
|
-
memory_usage_mb = round(proc.memory_info().rss / 1024.0 / 1024.0, 2)
|
|
789
|
+
memory_usage_mb = _current_rss_mb()
|
|
772
790
|
except Exception:
|
|
773
791
|
pass
|
|
774
792
|
|
|
@@ -1388,10 +1406,10 @@ async def _api_system(request, response):
|
|
|
1388
1406
|
"database": redact_url(os.environ.get("TINA4_DATABASE_URL", "not configured")),
|
|
1389
1407
|
}
|
|
1390
1408
|
|
|
1391
|
-
# Memory info
|
|
1409
|
+
# Memory info — current RSS; None where it cannot be measured (never the peak)
|
|
1392
1410
|
try:
|
|
1393
|
-
info["memory_mb"] =
|
|
1394
|
-
except
|
|
1411
|
+
info["memory_mb"] = _current_rss_mb()
|
|
1412
|
+
except Exception:
|
|
1395
1413
|
info["memory_mb"] = None
|
|
1396
1414
|
|
|
1397
1415
|
# Uptime
|
|
@@ -25,6 +25,7 @@ import json
|
|
|
25
25
|
import math
|
|
26
26
|
import secrets
|
|
27
27
|
import time
|
|
28
|
+
from collections import ChainMap
|
|
28
29
|
from functools import lru_cache
|
|
29
30
|
from pathlib import Path
|
|
30
31
|
from datetime import datetime, date
|
|
@@ -1969,9 +1970,14 @@ class Frond:
|
|
|
1969
1970
|
# When a module creates ``frond = Frond()`` and a hot-reload
|
|
1970
1971
|
# re-executes that line, the NEW instance inherits everything
|
|
1971
1972
|
# previously registered via add_global / add_filter / add_test.
|
|
1973
|
+
# They are read from here at render time, so they also reach engines
|
|
1974
|
+
# that already exist (ADR-0106, ADR-0107).
|
|
1972
1975
|
_class_globals: dict = {}
|
|
1973
1976
|
_class_filters: dict = {}
|
|
1974
1977
|
_class_tests: dict = {}
|
|
1978
|
+
# Bumped on every class-level filter/test change, so an engine knows when
|
|
1979
|
+
# to rebuild its merged filter/test maps (see _sync_registries).
|
|
1980
|
+
_class_registry_version: int = 0
|
|
1975
1981
|
# Live blocks: name -> body template source (registered when a {% live %}
|
|
1976
1982
|
# block renders); name -> data provider (registered via @live_source).
|
|
1977
1983
|
_class_live_fragments: dict = {}
|
|
@@ -1988,15 +1994,18 @@ class Frond:
|
|
|
1988
1994
|
cls._class_globals.clear()
|
|
1989
1995
|
cls._class_filters.clear()
|
|
1990
1996
|
cls._class_tests.clear()
|
|
1997
|
+
Frond._class_registry_version += 1
|
|
1991
1998
|
cls._class_live_fragments.clear()
|
|
1992
1999
|
cls._class_live_sources.clear()
|
|
1993
2000
|
cls._class_live_ws_paths.clear()
|
|
1994
2001
|
|
|
1995
2002
|
def __init__(self, template_dir: str = "src/templates"):
|
|
1996
2003
|
self.template_dir = Path(template_dir)
|
|
1997
|
-
|
|
1998
|
-
self.
|
|
1999
|
-
self.
|
|
2004
|
+
# This engine's own add_filter / add_test calls (instance-local).
|
|
2005
|
+
self._local_filters: dict = {}
|
|
2006
|
+
self._local_tests: dict = {}
|
|
2007
|
+
self._registry_version = -1
|
|
2008
|
+
self._sync_registries() # builds self._filters / self._tests
|
|
2000
2009
|
self._cache: dict[str, str] = {}
|
|
2001
2010
|
# Sandboxing
|
|
2002
2011
|
self._sandbox = False
|
|
@@ -2032,30 +2041,48 @@ class Frond:
|
|
|
2032
2041
|
self._cache_ttl = 0
|
|
2033
2042
|
|
|
2034
2043
|
# Built-in global functions
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2044
|
+
builtin_globals = {
|
|
2045
|
+
"form_token": _form_token,
|
|
2046
|
+
"formTokenValue": _form_token_value,
|
|
2047
|
+
"form_token_value": _form_token_value,
|
|
2048
|
+
"range": _frond_range,
|
|
2049
|
+
}
|
|
2039
2050
|
|
|
2040
2051
|
# Debug helper: {{ dump(x) }} — gated on TINA4_DEBUG=true.
|
|
2041
2052
|
# Both this global and the |dump filter call _render_dump() which
|
|
2042
2053
|
# returns an empty string in production so dump never leaks state.
|
|
2043
|
-
|
|
2054
|
+
builtin_globals["dump"] = _render_dump
|
|
2044
2055
|
|
|
2045
2056
|
# CSP nonce: {{ csp_nonce() }} returns the current response's nonce so a
|
|
2046
2057
|
# template can serve an inline <style>/<script> under the strict default
|
|
2047
2058
|
# Content-Security-Policy — <style nonce="{{ csp_nonce() }}">. The value
|
|
2048
2059
|
# matches the 'nonce-X' the security middleware puts in the CSP header.
|
|
2049
2060
|
from tina4_python.core.csp import csp_nonce as _csp_nonce
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
#
|
|
2053
|
-
#
|
|
2054
|
-
#
|
|
2055
|
-
#
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2061
|
+
builtin_globals["csp_nonce"] = _csp_nonce
|
|
2062
|
+
|
|
2063
|
+
# Globals resolve in three layers, highest first: this instance's own
|
|
2064
|
+
# add_global calls, the class registry, the built-ins. The class layer
|
|
2065
|
+
# is the LIVE ``Frond._class_globals`` dict, not a copy, so a
|
|
2066
|
+
# ``Frond.add_global(...)`` made after this engine exists (after the
|
|
2067
|
+
# first ``response.render``, say) still reaches every template it
|
|
2068
|
+
# renders. Instance writes land in the first map only, so they stay
|
|
2069
|
+
# local to this engine (ADR-0052, ADR-0106).
|
|
2070
|
+
self._globals = ChainMap({}, Frond._class_globals, builtin_globals)
|
|
2071
|
+
|
|
2072
|
+
def _sync_registries(self) -> None:
|
|
2073
|
+
"""Rebuild the merged filter/test maps when the class registry changed.
|
|
2074
|
+
|
|
2075
|
+
Same layering as globals -- built-ins < class < this instance -- so a
|
|
2076
|
+
``Frond.add_filter`` / ``add_test`` made after this engine exists still
|
|
2077
|
+
reaches every template it renders (ADR-0107). Filter lookup is on the
|
|
2078
|
+
hot path, so the merge is a plain dict rebuilt only when the class
|
|
2079
|
+
registry version moves, never a per-lookup chain.
|
|
2080
|
+
"""
|
|
2081
|
+
if self._registry_version == Frond._class_registry_version:
|
|
2082
|
+
return
|
|
2083
|
+
self._filters = {**_BUILTIN_FILTERS, **Frond._class_filters, **self._local_filters}
|
|
2084
|
+
self._tests = {**Frond._class_tests, **self._local_tests}
|
|
2085
|
+
self._registry_version = Frond._class_registry_version
|
|
2059
2086
|
|
|
2060
2087
|
def sandbox(self, allowed_filters: list[str] = None,
|
|
2061
2088
|
allowed_tags: list[str] = None,
|
|
@@ -2184,7 +2211,9 @@ class Frond:
|
|
|
2184
2211
|
"""
|
|
2185
2212
|
if instance is None:
|
|
2186
2213
|
cls._class_filters[name] = fn
|
|
2214
|
+
Frond._class_registry_version += 1
|
|
2187
2215
|
else:
|
|
2216
|
+
instance._local_filters[name] = fn
|
|
2188
2217
|
instance._filters[name] = fn
|
|
2189
2218
|
|
|
2190
2219
|
@_ClassOrInstanceMethod
|
|
@@ -2209,12 +2238,24 @@ class Frond:
|
|
|
2209
2238
|
"""
|
|
2210
2239
|
if instance is None:
|
|
2211
2240
|
cls._class_tests[name] = fn
|
|
2241
|
+
Frond._class_registry_version += 1
|
|
2212
2242
|
else:
|
|
2243
|
+
instance._local_tests[name] = fn
|
|
2213
2244
|
instance._tests[name] = fn
|
|
2214
2245
|
|
|
2246
|
+
def _context(self, data: dict | None) -> dict:
|
|
2247
|
+
"""Build a render context: built-ins < class globals < instance globals < data.
|
|
2248
|
+
|
|
2249
|
+
Every render starts here, so this is also where the filter/test maps
|
|
2250
|
+
catch up with any class registration made since the last render.
|
|
2251
|
+
"""
|
|
2252
|
+
self._sync_registries()
|
|
2253
|
+
local_globals, class_globals, builtin_globals = self._globals.maps
|
|
2254
|
+
return {**builtin_globals, **class_globals, **local_globals, **(data or {})}
|
|
2255
|
+
|
|
2215
2256
|
def render(self, template: str, data: dict = None) -> str:
|
|
2216
2257
|
"""Render a template with data. Uses token caching for performance."""
|
|
2217
|
-
context =
|
|
2258
|
+
context = self._context(data)
|
|
2218
2259
|
|
|
2219
2260
|
# Resolve file path and check mtime for cache validity
|
|
2220
2261
|
path = self.template_dir / template
|
|
@@ -2257,7 +2298,7 @@ class Frond:
|
|
|
2257
2298
|
|
|
2258
2299
|
def render_string(self, source: str, data: dict = None) -> str:
|
|
2259
2300
|
"""Render a template string directly. Uses token+AST caching."""
|
|
2260
|
-
context =
|
|
2301
|
+
context = self._context(data)
|
|
2261
2302
|
|
|
2262
2303
|
key = hashlib.md5(source.encode()).hexdigest()
|
|
2263
2304
|
cached = self._compiled_strings.get(key)
|
|
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
|