aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-04-24 18:03:55 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2023-04-24 18:03:55 +0200
commit3a00f977849b8d96a98236a5163d38a448103a3e (patch)
tree977de0b1b6705fa223b8bccfb6784c2d3d1913c7
parentChange imports to relative. (diff)
downloadmu4web-3a00f977849b8d96a98236a5163d38a448103a3e.tar.gz
mu4web-3a00f977849b8d96a98236a5163d38a448103a3e.tar.xz
Hopefully fix installation issues.
Diffstat (limited to '')
-rw-r--r--MANIFEST.in1
-rw-r--r--mu4web/main.py7
-rw-r--r--setup.cfg6
3 files changed, 9 insertions, 5 deletions
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..646cf51
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1 @@
+include mu4web/static/*
diff --git a/mu4web/main.py b/mu4web/main.py
index 681041e..c147ab7 100644
--- a/mu4web/main.py
+++ b/mu4web/main.py
@@ -149,7 +149,7 @@ def page_base(title: Optional[str] = None,
('meta', {'name': 'viewport',
'content': 'width=device-width, initial-scale=0.5'}),
('title', title, ' — Mu4Web'),
- include_stylesheet('/static/style.css'),
+ include_stylesheet(url_for('static', 'style.css')),
),
('body',
('nav',
@@ -500,7 +500,7 @@ class IMGParser(HTMLParser):
self.result += f' {key}="{data}"'
key = 'src'
- data = '/static/content-blocked.svg'
+ data = url_for('static', 'content-blocked.svg')
self.result += f' {key}="{data}"'
else:
key = html.escape(key)
@@ -571,7 +571,8 @@ def attachement_part_page():
# above, which unblocks it.
# TODO this "fails" for images wrapped in anchor tags, since
# the anchor tag has priority.
- result += "\n<script src='/static/enable_images.js'></script>"
+ url = url_for('static', 'enable_images.js')
+ result += f"\n<script src='{url}'></script>"
return str(result)
diff --git a/setup.cfg b/setup.cfg
index d8756da..688b4fa 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -24,8 +24,10 @@ install_requires =
# python-pam >= 2.0.2 for pam integration
setup_requires =
setuptools
-py_modules = mu4web
-packages = mu4web
+packages = find:
+include_package_data = True
+
+[options.packages.find]
[flake8]
ignore = E731