hyperflask 0.3.0__tar.gz → 0.3.1__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.
- {hyperflask-0.3.0 → hyperflask-0.3.1}/PKG-INFO +2 -2
- {hyperflask-0.3.0 → hyperflask-0.3.1}/pyproject.toml +2 -2
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/cli.py +12 -12
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/factory.py +3 -3
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/model.py +18 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/README.md +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/__init__.py +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/__main__.py +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/app.py +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/components/__init__.py +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/components/alpine.py +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/components/core.py +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/components/jsx.py +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/components/webcomponent.py +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/forms/__init__.py +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/forms/fields.py +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/forms/widgets.py +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/layouts/email.mjml +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/layouts/web.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/page_helpers.py +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/security.py +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/static/alpine-csp.js +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/static/alpine.js +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/static/app.css +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/static/app.js +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/static/htmx-exts.js +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/static/react.js +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/static/stimulus.js +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/static/translations.js +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Accordion.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/AccordionPanel.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Alert.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Avatar.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/AvatarGroup.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Badge.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Breadcrumbs.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/BreadcrumbsItem.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Button.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Card.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/CardActions.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/CardTitle.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/ChatBubble.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Checkbox.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/CollapsibleSubMenu.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Countdown.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Divider.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Drawer.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/DrawerContent.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/DrawerSide.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Dropdown.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/DropdownItem.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Fieldset.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/FieldsetLegend.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/FileInput.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Filter.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/FilterItem.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Footer.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/FooterLink.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/FooterNav.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Indicator.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Input.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/InputLabel.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Join.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Kbd.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Label.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/LabeledCheckbox.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/LabeledToggle.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Link.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/List.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/ListItem.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Loading.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Menu.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/MenuItem.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/MenuTitle.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Modal.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/ModalAction.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/ModalTitle.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Navbar.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Pagination.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/PaginationNext.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/PaginationPage.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/PaginationPrev.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Progress.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/README.md +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Radio.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Range.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Rating.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Select.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Stack.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Stat.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Stats.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Step.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Steps.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/SubMenu.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Swap.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Tab.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Table.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Tabs.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Textarea.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Toast.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Toggle.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/daisyui/Tooltip.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/flash.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/forms.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/icons.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/layout.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/metadata.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/modal.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/skeleton.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/ui/sse.html +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/utils/__init__.py +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/utils/html.py +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/utils/htmx.py +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/utils/markdown.py +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/utils/page_actions.py +0 -0
- {hyperflask-0.3.0 → hyperflask-0.3.1}/src/hyperflask/utils/tokens.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hyperflask
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: Full stack web framework
|
|
5
5
|
Author: Maxime Bouroumeau-Fuseau
|
|
6
6
|
Author-email: Maxime Bouroumeau-Fuseau <maxime.bouroumeau@gmail.com>
|
|
@@ -26,7 +26,7 @@ Requires-Dist: gunicorn~=23.0
|
|
|
26
26
|
Requires-Dist: honcho~=2.0
|
|
27
27
|
Requires-Dist: html-sanitizer~=2.6
|
|
28
28
|
Requires-Dist: htmx-flask~=0.1
|
|
29
|
-
Requires-Dist: jinja-layout~=0.
|
|
29
|
+
Requires-Dist: jinja-layout~=0.5
|
|
30
30
|
Requires-Dist: jinja-wtforms~=0.2
|
|
31
31
|
Requires-Dist: periodiq~=0.13
|
|
32
32
|
Requires-Dist: python-slugify~=8.0.4
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "hyperflask"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.1"
|
|
4
4
|
description = "Full stack web framework"
|
|
5
5
|
authors = [
|
|
6
6
|
{"name" = "Maxime Bouroumeau-Fuseau", email = "maxime.bouroumeau@gmail.com"}
|
|
@@ -32,7 +32,7 @@ dependencies = [
|
|
|
32
32
|
"honcho ~=2.0",
|
|
33
33
|
"html-sanitizer ~=2.6",
|
|
34
34
|
"htmx-flask ~=0.1",
|
|
35
|
-
"jinja-layout ~=0.
|
|
35
|
+
"jinja-layout ~=0.5",
|
|
36
36
|
"jinja-wtforms ~=0.2",
|
|
37
37
|
"periodiq ~=0.13",
|
|
38
38
|
"python-slugify ~=8.0.4",
|
|
@@ -7,6 +7,7 @@ import sys
|
|
|
7
7
|
import multiprocessing
|
|
8
8
|
import gunicorn.app.base
|
|
9
9
|
from .factory import load_config, create_app
|
|
10
|
+
from .security import generate_csp_policy
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
def _create_app():
|
|
@@ -22,20 +23,26 @@ cli.add_command(shell_command)
|
|
|
22
23
|
cli.add_command(routes_command)
|
|
23
24
|
|
|
24
25
|
|
|
25
|
-
@
|
|
26
|
+
@cli.command("init")
|
|
27
|
+
def init_command():
|
|
28
|
+
pass
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@cli.command("freeze")
|
|
26
32
|
def freeze_command():
|
|
27
33
|
current_app.freezer.freeze()
|
|
28
34
|
|
|
29
|
-
cli.add_command(freeze_command)
|
|
30
|
-
|
|
31
35
|
|
|
32
|
-
@
|
|
36
|
+
@cli.command("build")
|
|
33
37
|
@click.pass_context
|
|
34
38
|
def build_command(ctx):
|
|
35
39
|
ctx.invoke(assets_cli.build)
|
|
36
40
|
ctx.invoke(freeze_command)
|
|
37
41
|
|
|
38
|
-
|
|
42
|
+
|
|
43
|
+
@cli.command("csp-header")
|
|
44
|
+
def csp_header_command():
|
|
45
|
+
click.echo(generate_csp_policy())
|
|
39
46
|
|
|
40
47
|
|
|
41
48
|
@click.command("serve")
|
|
@@ -130,13 +137,6 @@ dev_command.params = list(run_command.params)
|
|
|
130
137
|
cli.add_command(dev_command)
|
|
131
138
|
|
|
132
139
|
|
|
133
|
-
@click.command("init")
|
|
134
|
-
def init_command():
|
|
135
|
-
pass
|
|
136
|
-
|
|
137
|
-
cli.add_command(init_command)
|
|
138
|
-
|
|
139
|
-
|
|
140
140
|
def main():
|
|
141
141
|
cli.main()
|
|
142
142
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
from .app import Hyperflask
|
|
2
1
|
from flask_configurator import Config
|
|
3
2
|
import importlib
|
|
4
3
|
from importlib.metadata import entry_points
|
|
5
4
|
import logging
|
|
6
5
|
import os
|
|
7
|
-
|
|
6
|
+
from .app import Hyperflask
|
|
7
|
+
from .model import init_db_locked
|
|
8
8
|
|
|
9
9
|
app = None
|
|
10
10
|
db = None
|
|
@@ -69,7 +69,7 @@ def create_app(root_path=None):
|
|
|
69
69
|
try_import(app, "app")
|
|
70
70
|
|
|
71
71
|
if models and app.config.get("INIT_DATABASE", True):
|
|
72
|
-
|
|
72
|
+
init_db_locked(app)
|
|
73
73
|
|
|
74
74
|
return app
|
|
75
75
|
|
|
@@ -5,6 +5,8 @@ from sqlorm.resultset import CompositeResultSet
|
|
|
5
5
|
from sqlorm import SQLType
|
|
6
6
|
from markupsafe import Markup
|
|
7
7
|
import abc
|
|
8
|
+
import os
|
|
9
|
+
import fcntl
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
File = SQLType("text", save_file, File.from_uri)
|
|
@@ -49,3 +51,19 @@ class Model(BaseModel, abc.ABC):
|
|
|
49
51
|
|
|
50
52
|
props = {prop: self} if prop else {}
|
|
51
53
|
return Markup(current_app.macros[macro](**props))
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def init_db_locked(app):
|
|
57
|
+
# this is required because multiple app process will start at the same time using the runner
|
|
58
|
+
lockfile = os.path.join(app.root_path, ".initdblock")
|
|
59
|
+
if os.path.exists(lockfile):
|
|
60
|
+
return False
|
|
61
|
+
with open(lockfile, "w") as f:
|
|
62
|
+
fcntl.flock(f.fileno(), fcntl.LOCK_EX)
|
|
63
|
+
f.write("lock\n")
|
|
64
|
+
fcntl.flock(f.fileno(), fcntl.LOCK_UN)
|
|
65
|
+
try:
|
|
66
|
+
app.db.init_db()
|
|
67
|
+
finally:
|
|
68
|
+
os.remove(lockfile)
|
|
69
|
+
return True
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|