pendify 0.1.9__tar.gz → 0.1.10__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.
- {pendify-0.1.9/src/pendify.egg-info → pendify-0.1.10}/PKG-INFO +1 -1
- {pendify-0.1.9 → pendify-0.1.10}/pyproject.toml +1 -1
- {pendify-0.1.9 → pendify-0.1.10}/src/pendify/page.py +13 -27
- pendify-0.1.10/src/pendify/sponsor_art.py +2951 -0
- {pendify-0.1.9 → pendify-0.1.10/src/pendify.egg-info}/PKG-INFO +1 -1
- {pendify-0.1.9 → pendify-0.1.10}/src/pendify.egg-info/SOURCES.txt +1 -0
- {pendify-0.1.9 → pendify-0.1.10}/LICENSE +0 -0
- {pendify-0.1.9 → pendify-0.1.10}/MANIFEST.in +0 -0
- {pendify-0.1.9 → pendify-0.1.10}/README.md +0 -0
- {pendify-0.1.9 → pendify-0.1.10}/setup.cfg +0 -0
- {pendify-0.1.9 → pendify-0.1.10}/src/pendify/__init__.py +0 -0
- {pendify-0.1.9 → pendify-0.1.10}/src/pendify/__main__.py +0 -0
- {pendify-0.1.9 → pendify-0.1.10}/src/pendify/alert.py +0 -0
- {pendify-0.1.9 → pendify-0.1.10}/src/pendify/autostart.py +0 -0
- {pendify-0.1.9 → pendify-0.1.10}/src/pendify/client.py +0 -0
- {pendify-0.1.9 → pendify-0.1.10}/src/pendify/codes.py +0 -0
- {pendify-0.1.9 → pendify-0.1.10}/src/pendify/config.py +0 -0
- {pendify-0.1.9 → pendify-0.1.10}/src/pendify/icon.py +0 -0
- {pendify-0.1.9 → pendify-0.1.10}/src/pendify/pairing.py +0 -0
- {pendify-0.1.9 → pendify-0.1.10}/src/pendify/pendify.ico +0 -0
- {pendify-0.1.9 → pendify-0.1.10}/src/pendify/plate_almena.py +0 -0
- {pendify-0.1.9 → pendify-0.1.10}/src/pendify/qr.py +0 -0
- {pendify-0.1.9 → pendify-0.1.10}/src/pendify/runfile.py +0 -0
- {pendify-0.1.9 → pendify-0.1.10}/src/pendify/tray.py +0 -0
- {pendify-0.1.9 → pendify-0.1.10}/src/pendify/update.py +0 -0
- {pendify-0.1.9 → pendify-0.1.10}/src/pendify/watcher.py +0 -0
- {pendify-0.1.9 → pendify-0.1.10}/src/pendify/worker.py +0 -0
- {pendify-0.1.9 → pendify-0.1.10}/src/pendify.egg-info/dependency_links.txt +0 -0
- {pendify-0.1.9 → pendify-0.1.10}/src/pendify.egg-info/top_level.txt +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pendify"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.10"
|
|
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,18 @@ def _mask(words):
|
|
|
719
719
|
f'{_MASK_GROUP * 3}</span>')
|
|
720
720
|
|
|
721
721
|
|
|
722
|
-
def
|
|
723
|
-
"""The sponsored QR
|
|
724
|
-
the
|
|
725
|
-
|
|
726
|
-
|
|
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
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
_SPONSOR_RUNS, _SPONSOR_SIDE = _sponsor_runs()
|
|
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)
|
|
741
727
|
|
|
742
728
|
|
|
743
|
-
def _sponsor_qr(words):
|
|
744
|
-
"""The sponsored QR:
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
f'height="
|
|
729
|
+
def _sponsor_qr(words, style):
|
|
730
|
+
"""The sponsored QR: the code of SPONSOR_ADDRESS in `style`, a picture of the app's own (sponsor_art.py: three
|
|
731
|
+
flat codes with the picture in the dots, two 3D stills), the same in both themes. `words` are escaped."""
|
|
732
|
+
return (f'<img class="qr2" src="{sponsor_art.data_uri(style)}" alt="{words["sponsor_qr"]}" width="264" '
|
|
733
|
+
f'height="264" data-style="{style}">')
|
|
748
734
|
|
|
749
735
|
|
|
750
736
|
def language(accept_language):
|
|
@@ -1014,8 +1000,8 @@ class PairingPage:
|
|
|
1014
1000
|
note = "" if snapshot["relinkOffered"] else f'<p class="note">{words["sponsor_note"]}</p>'
|
|
1015
1001
|
link.append(f'<aside class="side"><figure class="sponsor"><figcaption class="sponsor-by">'
|
|
1016
1002
|
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">
|
|
1018
|
-
f"</figure>{note}</aside>
|
|
1003
|
+
f'{_sponsor_qr(words, _pick_sponsor_style())}</div><p class="sponsor-cap">'
|
|
1004
|
+
f'{words["sponsor_cap"]}</p>{_PARTY}</figure>{note}</aside>')
|
|
1019
1005
|
typed = [f"<h2>{words['typed_title']}</h2>",
|
|
1020
1006
|
_form("typed", token, f'<label>{words["link_id_label"]} <input name="linkId" maxlength="32" '
|
|
1021
1007
|
f'autocomplete="off"></label><label>{words["secret_label"]} <input '
|