structables 0.3.3__tar.gz → 0.3.4__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.
- structables-0.3.4/.forgejo/workflows/release.yml +32 -0
- {structables-0.3.3 → structables-0.3.4}/PKG-INFO +1 -1
- {structables-0.3.3 → structables-0.3.4}/pyproject.toml +1 -1
- {structables-0.3.3 → structables-0.3.4}/src/structables/routes/main.py +2 -2
- {structables-0.3.3 → structables-0.3.4}/src/structables/routes/proxy.py +12 -2
- {structables-0.3.3 → structables-0.3.4}/src/structables/utils/helpers.py +2 -2
- {structables-0.3.3 → structables-0.3.4}/.gitignore +0 -0
- {structables-0.3.3 → structables-0.3.4}/LICENSE +0 -0
- {structables-0.3.3 → structables-0.3.4}/README.md +0 -0
- {structables-0.3.3 → structables-0.3.4}/cronjob.txt +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/__init__.py +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/config.py +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/main.py +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/routes/__init__.py +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/routes/category.py +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/routes/contest.py +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/routes/member.py +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/static/css/style.css +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/static/dist/css/bootstrap.min.css +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/static/dist/css/bootstrap.min.css.map +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/static/dist/js/bootstrap.bundle.min.js +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/static/dist/js/bootstrap.bundle.min.js.map +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/static/img/logo.png +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/static/img/logo_lg.png +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/static/img/magnifying-glass-solid.svg +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/templates/400.html +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/templates/404.html +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/templates/429.html +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/templates/500.html +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/templates/archives.html +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/templates/article-review.html +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/templates/article.html +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/templates/base.html +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/templates/category.html +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/templates/collection.html +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/templates/contest.html +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/templates/contests.html +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/templates/footer.html +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/templates/header.html +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/templates/iframe.html +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/templates/index.html +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/templates/member-instructables.html +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/templates/member.html +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/templates/privacypolicy.html +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/templates/projects.html +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/templates/sitemap.html +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/templates/style.html +0 -0
- {structables-0.3.3 → structables-0.3.4}/src/structables/utils/data.py +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Python Package CI/CD
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
push:
|
|
6
|
+
tags:
|
|
7
|
+
- "*"
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
publish:
|
|
11
|
+
name: Publish to PyPI
|
|
12
|
+
container:
|
|
13
|
+
image: node:20-bookworm
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- name: Check out code
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Install dependencies
|
|
20
|
+
run: |
|
|
21
|
+
apt update
|
|
22
|
+
apt install -y python3 python3-venv
|
|
23
|
+
|
|
24
|
+
- name: Publish to PyPI
|
|
25
|
+
run: |
|
|
26
|
+
python3 -m venv venv
|
|
27
|
+
. ./venv/bin/activate
|
|
28
|
+
pip install -U twine build
|
|
29
|
+
python -m build .
|
|
30
|
+
python -m twine upload --username __token__ --password ${PYPI_TOKEN} dist/*
|
|
31
|
+
env:
|
|
32
|
+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: structables
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: A simple frontend for Instructables
|
|
5
5
|
Project-URL: Homepage, https://git.private.coffee/privatecoffee/structables
|
|
6
6
|
Project-URL: Bug Tracker, https://git.private.coffee/privatecoffee/structables/issues
|
|
@@ -157,13 +157,13 @@ def init_main_routes(app):
|
|
|
157
157
|
for file in step["files"]:
|
|
158
158
|
if file["image"] and "embedType" not in "file":
|
|
159
159
|
step_imgs.append(
|
|
160
|
-
{"src": proxy(file["downloadUrl"]), "alt": file["name"]}
|
|
160
|
+
{"src": proxy(file["downloadUrl"], file["name"]), "alt": file["name"]}
|
|
161
161
|
)
|
|
162
162
|
|
|
163
163
|
elif not file["image"]:
|
|
164
164
|
step_downloads.append(
|
|
165
165
|
{
|
|
166
|
-
"src": proxy(file["downloadUrl"]),
|
|
166
|
+
"src": proxy(file["downloadUrl"], file["name"]),
|
|
167
167
|
"name": file["name"],
|
|
168
168
|
}
|
|
169
169
|
)
|
|
@@ -4,10 +4,13 @@ from urllib.parse import unquote
|
|
|
4
4
|
from urllib.error import HTTPError
|
|
5
5
|
from urllib.request import urlopen
|
|
6
6
|
|
|
7
|
+
|
|
7
8
|
def init_proxy_routes(app):
|
|
8
9
|
@app.route("/proxy/")
|
|
9
10
|
def route_proxy():
|
|
10
11
|
url = request.args.get("url")
|
|
12
|
+
filename = request.args.get("filename")
|
|
13
|
+
|
|
11
14
|
if url is not None:
|
|
12
15
|
if url.startswith("https://cdn.instructables.com/") or url.startswith(
|
|
13
16
|
"https://content.instructables.com/"
|
|
@@ -34,7 +37,14 @@ def init_proxy_routes(app):
|
|
|
34
37
|
except KeyError:
|
|
35
38
|
raise InternalServerError()
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
headers = dict()
|
|
41
|
+
|
|
42
|
+
if filename is not None:
|
|
43
|
+
headers["Content-Disposition"] = (
|
|
44
|
+
f'attachment; filename="{filename}"'
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
return Response(generate(), content_type=content_type, headers=headers)
|
|
38
48
|
else:
|
|
39
49
|
raise BadRequest()
|
|
40
50
|
else:
|
|
@@ -47,4 +57,4 @@ def init_proxy_routes(app):
|
|
|
47
57
|
if url is not None:
|
|
48
58
|
return render_template("iframe.html", url=url)
|
|
49
59
|
else:
|
|
50
|
-
raise BadRequest()
|
|
60
|
+
raise BadRequest()
|
|
@@ -9,9 +9,9 @@ from flask import request, render_template, abort
|
|
|
9
9
|
logging.basicConfig(level=logging.DEBUG)
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
def proxy(url):
|
|
12
|
+
def proxy(url, filename=None):
|
|
13
13
|
logging.debug(f"Generating proxy URL for {url}")
|
|
14
|
-
return f"/proxy/?url={url}"
|
|
14
|
+
return f"/proxy/?url={url}" + (f"&filename={filename}" if filename else "")
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
def get_typesense_api_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
|
{structables-0.3.3 → structables-0.3.4}/src/structables/static/dist/css/bootstrap.min.css.map
RENAMED
|
File without changes
|
{structables-0.3.3 → structables-0.3.4}/src/structables/static/dist/js/bootstrap.bundle.min.js
RENAMED
|
File without changes
|
{structables-0.3.3 → structables-0.3.4}/src/structables/static/dist/js/bootstrap.bundle.min.js.map
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{structables-0.3.3 → structables-0.3.4}/src/structables/static/img/magnifying-glass-solid.svg
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
|