structables 0.3.2__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.
Files changed (49) hide show
  1. structables-0.3.4/.forgejo/workflows/release.yml +32 -0
  2. {structables-0.3.2 → structables-0.3.4}/PKG-INFO +1 -1
  3. {structables-0.3.2 → structables-0.3.4}/pyproject.toml +1 -1
  4. {structables-0.3.2 → structables-0.3.4}/src/structables/routes/main.py +2 -2
  5. {structables-0.3.2 → structables-0.3.4}/src/structables/routes/proxy.py +12 -2
  6. structables-0.3.4/src/structables/templates/footer.html +21 -0
  7. {structables-0.3.2 → structables-0.3.4}/src/structables/templates/index.html +2 -0
  8. {structables-0.3.2 → structables-0.3.4}/src/structables/utils/helpers.py +2 -2
  9. structables-0.3.2/src/structables/templates/footer.html +0 -11
  10. {structables-0.3.2 → structables-0.3.4}/.gitignore +0 -0
  11. {structables-0.3.2 → structables-0.3.4}/LICENSE +0 -0
  12. {structables-0.3.2 → structables-0.3.4}/README.md +0 -0
  13. {structables-0.3.2 → structables-0.3.4}/cronjob.txt +0 -0
  14. {structables-0.3.2 → structables-0.3.4}/src/structables/__init__.py +0 -0
  15. {structables-0.3.2 → structables-0.3.4}/src/structables/config.py +0 -0
  16. {structables-0.3.2 → structables-0.3.4}/src/structables/main.py +0 -0
  17. {structables-0.3.2 → structables-0.3.4}/src/structables/routes/__init__.py +0 -0
  18. {structables-0.3.2 → structables-0.3.4}/src/structables/routes/category.py +0 -0
  19. {structables-0.3.2 → structables-0.3.4}/src/structables/routes/contest.py +0 -0
  20. {structables-0.3.2 → structables-0.3.4}/src/structables/routes/member.py +0 -0
  21. {structables-0.3.2 → structables-0.3.4}/src/structables/static/css/style.css +0 -0
  22. {structables-0.3.2 → structables-0.3.4}/src/structables/static/dist/css/bootstrap.min.css +0 -0
  23. {structables-0.3.2 → structables-0.3.4}/src/structables/static/dist/css/bootstrap.min.css.map +0 -0
  24. {structables-0.3.2 → structables-0.3.4}/src/structables/static/dist/js/bootstrap.bundle.min.js +0 -0
  25. {structables-0.3.2 → structables-0.3.4}/src/structables/static/dist/js/bootstrap.bundle.min.js.map +0 -0
  26. {structables-0.3.2 → structables-0.3.4}/src/structables/static/img/logo.png +0 -0
  27. {structables-0.3.2 → structables-0.3.4}/src/structables/static/img/logo_lg.png +0 -0
  28. {structables-0.3.2 → structables-0.3.4}/src/structables/static/img/magnifying-glass-solid.svg +0 -0
  29. {structables-0.3.2 → structables-0.3.4}/src/structables/templates/400.html +0 -0
  30. {structables-0.3.2 → structables-0.3.4}/src/structables/templates/404.html +0 -0
  31. {structables-0.3.2 → structables-0.3.4}/src/structables/templates/429.html +0 -0
  32. {structables-0.3.2 → structables-0.3.4}/src/structables/templates/500.html +0 -0
  33. {structables-0.3.2 → structables-0.3.4}/src/structables/templates/archives.html +0 -0
  34. {structables-0.3.2 → structables-0.3.4}/src/structables/templates/article-review.html +0 -0
  35. {structables-0.3.2 → structables-0.3.4}/src/structables/templates/article.html +0 -0
  36. {structables-0.3.2 → structables-0.3.4}/src/structables/templates/base.html +0 -0
  37. {structables-0.3.2 → structables-0.3.4}/src/structables/templates/category.html +0 -0
  38. {structables-0.3.2 → structables-0.3.4}/src/structables/templates/collection.html +0 -0
  39. {structables-0.3.2 → structables-0.3.4}/src/structables/templates/contest.html +0 -0
  40. {structables-0.3.2 → structables-0.3.4}/src/structables/templates/contests.html +0 -0
  41. {structables-0.3.2 → structables-0.3.4}/src/structables/templates/header.html +0 -0
  42. {structables-0.3.2 → structables-0.3.4}/src/structables/templates/iframe.html +0 -0
  43. {structables-0.3.2 → structables-0.3.4}/src/structables/templates/member-instructables.html +0 -0
  44. {structables-0.3.2 → structables-0.3.4}/src/structables/templates/member.html +0 -0
  45. {structables-0.3.2 → structables-0.3.4}/src/structables/templates/privacypolicy.html +0 -0
  46. {structables-0.3.2 → structables-0.3.4}/src/structables/templates/projects.html +0 -0
  47. {structables-0.3.2 → structables-0.3.4}/src/structables/templates/sitemap.html +0 -0
  48. {structables-0.3.2 → structables-0.3.4}/src/structables/templates/style.html +0 -0
  49. {structables-0.3.2 → 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.2
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
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "structables"
7
- version = "0.3.2"
7
+ version = "0.3.4"
8
8
  authors = [
9
9
  { name="Private.coffee Team", email="support@private.coffee" },
10
10
  ]
@@ -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
- return Response(generate(), content_type=content_type)
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()
@@ -0,0 +1,21 @@
1
+ <footer class="bg-light text-dark py-4">
2
+ <div class="container">
3
+ <div class="row">
4
+ <div class="col-md-6 text-center text-md-left">
5
+ <p class="mb-1">
6
+ <a
7
+ href="https://git.private.coffee/PrivateCoffee/structables"
8
+ class="text-dark"
9
+ >
10
+ Structables Code (AGPLv3)
11
+ </a>
12
+ </p>
13
+ </div>
14
+ <div class="col-md-6 text-center text-md-right">
15
+ <p class="mb-1">
16
+ <a href="/privacypolicy" class="text-dark">View privacy policy</a>
17
+ </p>
18
+ </div>
19
+ </div>
20
+ </div>
21
+ </footer>
@@ -36,7 +36,9 @@
36
36
  </div>
37
37
  {% endfor %}
38
38
  </div>
39
+ {% if section != sections[-1] %}
39
40
  <hr />
41
+ {% endif %}
40
42
  </section>
41
43
  {% endfor %}
42
44
  </div>
@@ -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():
@@ -1,11 +0,0 @@
1
- <footer class="text-center">
2
- <hr />
3
- <p>
4
- <a href="https://git.private.coffee/PrivateCoffee/structables"
5
- >Structables Code (AGPLv3)</a
6
- >
7
- </p>
8
- <p>
9
- <a href="/privacypolicy">View privacy policy.</a>
10
- </p>
11
- </footer>
File without changes
File without changes
File without changes
File without changes