pendify 0.1.9__tar.gz → 0.1.11__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 (29) hide show
  1. {pendify-0.1.9/src/pendify.egg-info → pendify-0.1.11}/PKG-INFO +1 -1
  2. {pendify-0.1.9 → pendify-0.1.11}/pyproject.toml +1 -1
  3. {pendify-0.1.9 → pendify-0.1.11}/src/pendify/page.py +22 -26
  4. pendify-0.1.11/src/pendify/sponsor_art.py +2951 -0
  5. {pendify-0.1.9 → pendify-0.1.11/src/pendify.egg-info}/PKG-INFO +1 -1
  6. {pendify-0.1.9 → pendify-0.1.11}/src/pendify.egg-info/SOURCES.txt +1 -0
  7. {pendify-0.1.9 → pendify-0.1.11}/LICENSE +0 -0
  8. {pendify-0.1.9 → pendify-0.1.11}/MANIFEST.in +0 -0
  9. {pendify-0.1.9 → pendify-0.1.11}/README.md +0 -0
  10. {pendify-0.1.9 → pendify-0.1.11}/setup.cfg +0 -0
  11. {pendify-0.1.9 → pendify-0.1.11}/src/pendify/__init__.py +0 -0
  12. {pendify-0.1.9 → pendify-0.1.11}/src/pendify/__main__.py +0 -0
  13. {pendify-0.1.9 → pendify-0.1.11}/src/pendify/alert.py +0 -0
  14. {pendify-0.1.9 → pendify-0.1.11}/src/pendify/autostart.py +0 -0
  15. {pendify-0.1.9 → pendify-0.1.11}/src/pendify/client.py +0 -0
  16. {pendify-0.1.9 → pendify-0.1.11}/src/pendify/codes.py +0 -0
  17. {pendify-0.1.9 → pendify-0.1.11}/src/pendify/config.py +0 -0
  18. {pendify-0.1.9 → pendify-0.1.11}/src/pendify/icon.py +0 -0
  19. {pendify-0.1.9 → pendify-0.1.11}/src/pendify/pairing.py +0 -0
  20. {pendify-0.1.9 → pendify-0.1.11}/src/pendify/pendify.ico +0 -0
  21. {pendify-0.1.9 → pendify-0.1.11}/src/pendify/plate_almena.py +0 -0
  22. {pendify-0.1.9 → pendify-0.1.11}/src/pendify/qr.py +0 -0
  23. {pendify-0.1.9 → pendify-0.1.11}/src/pendify/runfile.py +0 -0
  24. {pendify-0.1.9 → pendify-0.1.11}/src/pendify/tray.py +0 -0
  25. {pendify-0.1.9 → pendify-0.1.11}/src/pendify/update.py +0 -0
  26. {pendify-0.1.9 → pendify-0.1.11}/src/pendify/watcher.py +0 -0
  27. {pendify-0.1.9 → pendify-0.1.11}/src/pendify/worker.py +0 -0
  28. {pendify-0.1.9 → pendify-0.1.11}/src/pendify.egg-info/dependency_links.txt +0 -0
  29. {pendify-0.1.9 → pendify-0.1.11}/src/pendify.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pendify
3
- Version: 0.1.9
3
+ Version: 0.1.11
4
4
  Summary: Pairs this PC with a phone account by a QR on a loopback page and sends it two kinds of alerts.
5
5
  License-Expression: MIT
6
6
  Project-URL: Homepage, https://github.com/ElkinDev/PendiFy
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pendify"
7
- version = "0.1.9"
7
+ version = "0.1.11"
8
8
  description = "Pairs this PC with a phone account by a QR on a loopback page and sends it two kinds of alerts."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -16,7 +16,7 @@ import time
16
16
  import urllib.parse
17
17
  from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
18
18
 
19
- from . import codes, config, icon, plate_almena, qr, update
19
+ from . import codes, config, icon, plate_almena, qr, sponsor_art, update
20
20
 
21
21
  ADDRESS = "127.0.0.1"
22
22
  MAX_FORM_BYTES = 4096
@@ -719,32 +719,25 @@ def _mask(words):
719
719
  f'{_MASK_GROUP * 3}</span>')
720
720
 
721
721
 
722
- def _sponsor_runs():
723
- """The sponsored QR's dark modules as one path's runs, one module tall, inside the quiet zone; and the side of
724
- the whole square, quiet zone included."""
725
- modules = qr.encode(SPONSOR_ADDRESS.encode("ascii")).modules
726
- runs = []
727
- for y, row in enumerate(modules):
728
- x = 0
729
- while x < len(row):
730
- if not row[x]:
731
- x += 1
732
- continue
733
- start = x
734
- while x < len(row) and row[x]:
735
- x += 1
736
- runs.append(f"M{start + qr.QUIET_ZONE} {y + qr.QUIET_ZONE}h{x - start}v1h-{x - start}z")
737
- return "".join(runs), len(modules) + 2 * qr.QUIET_ZONE
722
+ def _pick_sponsor_style():
723
+ """The style the sponsored QR is drawn in, picked again at every render of the linked page, one of
724
+ sponsor_art.STYLES at random (the standard random module: a cosmetic pick, as the mask's; owner 2026-10-03
725
+ 20:1x). The one seam the tests replace."""
726
+ return random.choice(sponsor_art.STYLES)
738
727
 
739
728
 
740
- _SPONSOR_RUNS, _SPONSOR_SIDE = _sponsor_runs()
729
+ def _running_version():
730
+ """The version this copy runs, as update.py read it once at the start, for the top bar's credit; None when it
731
+ could not be read. Never a fresh read of the disk: after an update is installed and before the restart, the page
732
+ still names the copy that runs (owner 2026-10-03 21:0x, OR-114). The one seam the tests replace."""
733
+ return update.RUNNING_VERSION
741
734
 
742
735
 
743
- def _sponsor_qr(words):
744
- """The sponsored QR: square dark modules on a light field, the same in both themes. `words` are escaped."""
745
- return (f'<svg class="qr2" viewBox="0 0 {_SPONSOR_SIDE} {_SPONSOR_SIDE}" role="img" '
746
- f'aria-label="{words["sponsor_qr"]}" shape-rendering="crispEdges"><rect width="{_SPONSOR_SIDE}" '
747
- f'height="{_SPONSOR_SIDE}" fill="#FFFFFF"/><path fill="#1E1533" d="{_SPONSOR_RUNS}"/></svg>')
736
+ def _sponsor_qr(words, style):
737
+ """The sponsored QR: the code of SPONSOR_ADDRESS in `style`, a picture of the app's own (sponsor_art.py: three
738
+ flat codes with the picture in the dots, two 3D stills), the same in both themes. `words` are escaped."""
739
+ return (f'<img class="qr2" src="{sponsor_art.data_uri(style)}" alt="{words["sponsor_qr"]}" width="264" '
740
+ f'height="264" data-style="{style}">')
748
741
 
749
742
 
750
743
  def language(accept_language):
@@ -1014,8 +1007,8 @@ class PairingPage:
1014
1007
  note = "" if snapshot["relinkOffered"] else f'<p class="note">{words["sponsor_note"]}</p>'
1015
1008
  link.append(f'<aside class="side"><figure class="sponsor"><figcaption class="sponsor-by">'
1016
1009
  f'{words["sponsor_by"]}</figcaption><div class="arcade"><i></i><i></i><i></i><i></i>'
1017
- f'{_sponsor_qr(words)}</div><p class="sponsor-cap">{words["sponsor_cap"]}</p>{_PARTY}'
1018
- f"</figure>{note}</aside>")
1010
+ f'{_sponsor_qr(words, _pick_sponsor_style())}</div><p class="sponsor-cap">'
1011
+ f'{words["sponsor_cap"]}</p>{_PARTY}</figure>{note}</aside>')
1019
1012
  typed = [f"<h2>{words['typed_title']}</h2>",
1020
1013
  _form("typed", token, f'<label>{words["link_id_label"]} <input name="linkId" maxlength="32" '
1021
1014
  f'autocomplete="off"></label><label>{words["secret_label"]} <input '
@@ -1028,8 +1021,11 @@ class PairingPage:
1028
1021
  quit_button = f'<button type="submit">{words["quit"]}</button>'
1029
1022
  quit_form = "" if self.on_quit is None else _form("quit", token, quit_button)
1030
1023
  foot = "" if self.on_quit is None else f'<footer class="foot">{quit_form}</footer>'
1024
+ # The credit ends with the running version after the repository link, when it is known (lane pfver, OR-114).
1025
+ version = _running_version()
1026
+ running = "" if version is None else f' · <span class="version">v{html.escape(version)}</span>'
1031
1027
  credit = (f'<p class="credit">{words["credit"]} <b>{CREATOR}</b> · <a href="{REPOSITORY}" target="_blank" '
1032
- f'rel="noopener noreferrer">{REPOSITORY.removeprefix("https://")}</a></p>')
1028
+ f'rel="noopener noreferrer">{REPOSITORY.removeprefix("https://")}</a>{running}</p>')
1033
1029
  # The typed link and the forget in one fold, open when the typed values were refused so the note shows.
1034
1030
  fold = " open" if snapshot["typedRefused"] else ""
1035
1031
  bar = (f'<header class="bar">{credit}{_switch(words, token, lang)}<button id="theme-toggle" class="icon-btn" '