pyonir 0.2.0__tar.gz → 0.2.2__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.
- {pyonir-0.2.0/pyonir.egg-info → pyonir-0.2.2}/PKG-INFO +1 -1
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/core/app.py +9 -4
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/core/server.py +2 -2
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/core/utils.py +3 -4
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/templates/nginx.jinja.conf +3 -0
- {pyonir-0.2.0 → pyonir-0.2.2/pyonir.egg-info}/PKG-INFO +1 -1
- {pyonir-0.2.0 → pyonir-0.2.2}/pyproject.toml +1 -1
- {pyonir-0.2.0 → pyonir-0.2.2}/LICENSE.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/MANIFEST.in +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/README.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/__init__.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/cli.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/core/__init__.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/core/database.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/core/generators.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/core/loaders.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/core/mapper.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/core/media.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/core/media_service.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/core/page.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/core/parser.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/core/schemas.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/core/security.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/core/services.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/core/templating.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/docs/backend.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/docs/content-file-structure.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/docs/content.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/docs/file-routing.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/docs/frontend.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/docs/plugin-setup.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/docs/routing-setup.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/__init__.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/.env.example +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/README.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/backend/README.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/backend/__init__.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/contents/api/demo-sse-resolver.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/contents/api/docs.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/contents/configs/app.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/contents/pages/.virtual_routes.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/contents/pages/blogs/digital-artists.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/contents/pages/blogs/index.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/contents/pages/blogs/styleguide-for-pencil-theme.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/contents/pages/demo.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/contents/pages/index.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/contents/pages/sse-demo.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/contents/pages/test.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/contents/pages/uploader-demo.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/contents/pages/wss-demo.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/README.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/public/test_image.png +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/README.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/static/css/button.css +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/static/css/forms.css +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/static/css/grid.css +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/static/css/menus.css +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/static/css/pencil.css +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/static/css/props.css +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/static/css/recommendation-card.css +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/static/css/reset.css +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/static/css/table.css +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/static/css/typography.css +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/static/favicon.ico +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/static/images/circuits.jpg +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/templates/40x.html +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/templates/components/listing.html +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/templates/components/navigation.html +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/templates/components/pagination.html +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/templates/pages.html +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/templates/sample-page.html +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/main.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/extensions/IncludeOnceExtension.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/filters/asjson.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/filters/format.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/filters/iml.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/filters/limit.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/filters/readJSON.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/filters/sortby.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/filters/valueFrom.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/templates/head.html +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/templates/multimedia.html +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/templates/nginx-cache-config.jinja.conf +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/templates/nginx-ssl.jinja.conf +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/templates/pages.html +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/templates/robots.jinja.txt +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/templates/schema-page.jinja.html +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/templates/seo.html +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/templates/sitemap.jinja.xml +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/templates/sql.jinja.sql +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/templates/system_macros.html +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/templates/ui_components/gallery.html +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/templates/ui_components/pagination.html +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/templates/ui_components/sharethis.html +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/jinja/templates/uwsgi.jinja.ini +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/plugins/README.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/plugins/__init__.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/plugins/navigation/__init__.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/plugins/navigation/templates/navigation-menu.html +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/plugins/navigation/test_navigation.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/plugins/navigation/tests/page_one.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/plugins/navigation/tests/page_two.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/plugins/navigation/tests/sub_page.md +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/pyonir_types.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/tests/__init__.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/tests/conftest.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/tests/speedtest.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/tests/test_basefsquery.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/tests/test_basemedia.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/tests/test_database.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/tests/test_deserializefile.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/tests/test_jinja_extension.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/tests/test_mappers.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/tests/test_schema_sql.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/tests/test_user.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir/tests/test_utils_merge_dict.py +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir.egg-info/SOURCES.txt +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir.egg-info/dependency_links.txt +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir.egg-info/entry_points.txt +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir.egg-info/requires.txt +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/pyonir.egg-info/top_level.txt +0 -0
- {pyonir-0.2.0 → pyonir-0.2.2}/setup.cfg +0 -0
|
@@ -585,8 +585,13 @@ class BaseApp(Base):
|
|
|
585
585
|
|
|
586
586
|
@property
|
|
587
587
|
def domain(self) -> str:
|
|
588
|
-
|
|
589
|
-
return f"{self.
|
|
588
|
+
"""Returns the application's domain or host address."""
|
|
589
|
+
return get_attr(self.env, 'app.domain', self.host) or f"{self.host}:{self.port}"
|
|
590
|
+
|
|
591
|
+
@property
|
|
592
|
+
def domain_url(self) -> str:
|
|
593
|
+
"""Returns the application's fully qualified URL."""
|
|
594
|
+
return f"{self.protocol}://{self.domain}"
|
|
590
595
|
|
|
591
596
|
@property
|
|
592
597
|
def is_secure(self) -> bool:
|
|
@@ -710,10 +715,10 @@ class BaseApp(Base):
|
|
|
710
715
|
if not global_vars: global_vars = {}
|
|
711
716
|
self.TemplateEnvironment.globals.update({**self.TemplateEnvironment.context, **global_vars})
|
|
712
717
|
|
|
713
|
-
def generate_nginx_config_file(self, template_path: str = None, context: dict = None):
|
|
718
|
+
def generate_nginx_config_file(self, template_path: str = None, context: dict = None) -> bool:
|
|
714
719
|
"""Generates Nginx configuration file for the application"""
|
|
715
720
|
from pyonir.core.server import generate_nginx_conf
|
|
716
|
-
generate_nginx_conf(self)
|
|
721
|
+
return generate_nginx_conf(self)
|
|
717
722
|
|
|
718
723
|
def run(self, uvicorn_options: dict = None):
|
|
719
724
|
"""Runs the Uvicorn webserver"""
|
|
@@ -42,9 +42,10 @@ PROD_ENV: str = "PROD"
|
|
|
42
42
|
def generate_nginx_conf(app: BaseApp) -> bool:
|
|
43
43
|
"""Generates a NGINX conf file based on App configurations"""
|
|
44
44
|
from pyonir.core.utils import create_file, get_attr
|
|
45
|
+
from datetime import datetime, timezone
|
|
45
46
|
|
|
46
|
-
nginx_app_baseurl = get_attr(app.env, "nginx.baseurl")
|
|
47
47
|
nginx_conf = app.TemplateEnvironment.get_template("nginx.jinja.conf").render(
|
|
48
|
+
generated_at=datetime.now(timezone.utc).isoformat(),
|
|
48
49
|
app_name=app.name,
|
|
49
50
|
app_name_id=app.name.replace(" ", "_").lower(),
|
|
50
51
|
domain=app.domain,
|
|
@@ -66,7 +67,6 @@ def generate_nginx_conf(app: BaseApp) -> bool:
|
|
|
66
67
|
custom_nginx_locations=get_attr(app.configs, "nginx.locations"),
|
|
67
68
|
**app.TemplateEnvironment.context,
|
|
68
69
|
)
|
|
69
|
-
if not os.path.exists(app.nginx_config_filepath): return False
|
|
70
70
|
return create_file(app.nginx_config_filepath, nginx_conf, False)
|
|
71
71
|
|
|
72
72
|
|
|
@@ -324,9 +324,9 @@ def create_file(file_abspath: str, data: any = None, is_json: bool = False, mode
|
|
|
324
324
|
else:
|
|
325
325
|
f.write(data)
|
|
326
326
|
|
|
327
|
-
if not os.path.exists(os.path.dirname(file_abspath)):
|
|
328
|
-
os.makedirs(os.path.dirname(file_abspath))
|
|
329
327
|
try:
|
|
328
|
+
if not os.path.exists(os.path.dirname(file_abspath)):
|
|
329
|
+
os.makedirs(os.path.dirname(file_abspath))
|
|
330
330
|
is_json = is_json or file_abspath.endswith('.json')
|
|
331
331
|
if not use_atomic:
|
|
332
332
|
write_file(file_abspath, data, is_json=is_json, mode=mode)
|
|
@@ -337,8 +337,7 @@ def create_file(file_abspath: str, data: any = None, is_json: bool = False, mode
|
|
|
337
337
|
os.replace(tmp_filepath, file_abspath)
|
|
338
338
|
return True
|
|
339
339
|
except Exception as e:
|
|
340
|
-
|
|
341
|
-
return False
|
|
340
|
+
raise e
|
|
342
341
|
|
|
343
342
|
def copy_assets(src: str, dst: str, purge: bool = True, ignore: list[str] = None) -> None:
|
|
344
343
|
"""Copies files from a source directory into a destination directory with option to purge destination"""
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/static/css/button.css
RENAMED
|
File without changes
|
{pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/static/css/forms.css
RENAMED
|
File without changes
|
{pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/static/css/grid.css
RENAMED
|
File without changes
|
{pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/static/css/menus.css
RENAMED
|
File without changes
|
{pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/static/css/pencil.css
RENAMED
|
File without changes
|
{pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/static/css/props.css
RENAMED
|
File without changes
|
|
File without changes
|
{pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/static/css/reset.css
RENAMED
|
File without changes
|
{pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/static/css/table.css
RENAMED
|
File without changes
|
{pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/static/css/typography.css
RENAMED
|
File without changes
|
{pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/static/favicon.ico
RENAMED
|
File without changes
|
|
File without changes
|
{pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/templates/40x.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyonir-0.2.0 → pyonir-0.2.2}/pyonir/libs/app_setup/frontend/themes/pencil/templates/pages.html
RENAMED
|
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
|
|
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
|