epok-toolkit 1.1.0__tar.gz → 1.2.0__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.
Potentially problematic release.
This version of epok-toolkit might be problematic. Click here for more details.
- epok_toolkit-1.2.0/MANIFEST.in +7 -0
- {epok_toolkit-1.1.0/epok_toolkit.egg-info → epok_toolkit-1.2.0}/PKG-INFO +1 -1
- epok_toolkit-1.2.0/epok_toolkit/pdf/fuentes/Kollektif-Bold.ttf +0 -0
- epok_toolkit-1.2.0/epok_toolkit/pdf/fuentes/Kollektif-BoldItalic.ttf +0 -0
- epok_toolkit-1.2.0/epok_toolkit/pdf/fuentes/Kollektif-Italic.ttf +0 -0
- epok_toolkit-1.2.0/epok_toolkit/pdf/fuentes/Kollektif.ttf +0 -0
- epok_toolkit-1.2.0/epok_toolkit/pdf/plantillas/Ticket_congrats.png +0 -0
- epok_toolkit-1.2.0/epok_toolkit/pdf/plantillas/Ticket_congrats2.png +0 -0
- {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/pdf/ticket_pdf.py +7 -3
- {epok_toolkit-1.1.0 → epok_toolkit-1.2.0/epok_toolkit.egg-info}/PKG-INFO +1 -1
- {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit.egg-info/SOURCES.txt +7 -1
- {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/pyproject.toml +1 -1
- epok_toolkit-1.1.0/MANIFEST.in +0 -4
- {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/LICENSE +0 -0
- {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/README.md +0 -0
- {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/__init__.py +0 -0
- {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/apps.py +0 -0
- {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/default_settings.py +0 -0
- {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/email/__init__.py +0 -0
- {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/email/email_async.py +0 -0
- {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/email/engine.py +0 -0
- {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/email/templates.py +0 -0
- {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/messaging/__init__.py +0 -0
- {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/messaging/whatsapp.py +0 -0
- {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/messaging/whatsapp_instanced.py +0 -0
- {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/pdf/__init__.py +0 -0
- {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit.egg-info/dependency_links.txt +0 -0
- {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit.egg-info/requires.txt +0 -0
- {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit.egg-info/top_level.txt +0 -0
- {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/setup.cfg +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -12,6 +12,7 @@ from uuid import uuid4, UUID
|
|
|
12
12
|
import os
|
|
13
13
|
import qrcode
|
|
14
14
|
from io import BytesIO
|
|
15
|
+
import importlib.resources
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
# pip install reportlab qrcode
|
|
@@ -30,7 +31,7 @@ def hex_to_rgb(hex_color):
|
|
|
30
31
|
class Config:
|
|
31
32
|
base_path = os.path.dirname(__file__)
|
|
32
33
|
plantillas = base_path + "/plantillas/"
|
|
33
|
-
plantilla_path =
|
|
34
|
+
plantilla_path = importlib.resources.files("epok_toolkit.pdf.plantillas").joinpath("Ticket_congrats.png")
|
|
34
35
|
output_path = os.path.join(base_path, "ticket_final.pdf")
|
|
35
36
|
fuente = "Helvetica"
|
|
36
37
|
fuente_bold = "kollektif"
|
|
@@ -145,7 +146,9 @@ class TicketPDF:
|
|
|
145
146
|
self.font_color = Config.font_color
|
|
146
147
|
self.color = Config.bg_color
|
|
147
148
|
self.fuente = Config.fuente
|
|
148
|
-
|
|
149
|
+
with Config.plantilla_path.open("rb") as f:
|
|
150
|
+
self.img = Image.open(f)
|
|
151
|
+
self.img.load()
|
|
149
152
|
self.width, self.height = self.img.size
|
|
150
153
|
self.buffer = BytesIO()
|
|
151
154
|
self.c = canvas.Canvas(self.buffer, pagesize=(self.width, self.height))
|
|
@@ -153,7 +156,8 @@ class TicketPDF:
|
|
|
153
156
|
|
|
154
157
|
def generate_ticket(self):
|
|
155
158
|
def y(px): return self.height - px
|
|
156
|
-
|
|
159
|
+
with Config.plantilla_path.open("rb") as f:
|
|
160
|
+
self.c.drawImage(ImageReader(f), 0, 0, width=self.width, height=self.height, mask='auto')
|
|
157
161
|
|
|
158
162
|
# NOMBRE EVENTO
|
|
159
163
|
nombre_evento = ContenedorTexto(x=260, y=y(210), w=1400, h=90, texto=self.nombre_evento, font_size=78, bold=True)
|
|
@@ -18,4 +18,10 @@ epok_toolkit/messaging/__init__.py
|
|
|
18
18
|
epok_toolkit/messaging/whatsapp.py
|
|
19
19
|
epok_toolkit/messaging/whatsapp_instanced.py
|
|
20
20
|
epok_toolkit/pdf/__init__.py
|
|
21
|
-
epok_toolkit/pdf/ticket_pdf.py
|
|
21
|
+
epok_toolkit/pdf/ticket_pdf.py
|
|
22
|
+
epok_toolkit/pdf/fuentes/Kollektif-Bold.ttf
|
|
23
|
+
epok_toolkit/pdf/fuentes/Kollektif-BoldItalic.ttf
|
|
24
|
+
epok_toolkit/pdf/fuentes/Kollektif-Italic.ttf
|
|
25
|
+
epok_toolkit/pdf/fuentes/Kollektif.ttf
|
|
26
|
+
epok_toolkit/pdf/plantillas/Ticket_congrats.png
|
|
27
|
+
epok_toolkit/pdf/plantillas/Ticket_congrats2.png
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "epok-toolkit"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.2.0"
|
|
8
8
|
description = "A toolkit for building Django applications with Celery support"
|
|
9
9
|
authors = [
|
|
10
10
|
{ name="Fernando Leon Franco", email="fernanlee2131@gmail.com" }
|
epok_toolkit-1.1.0/MANIFEST.in
DELETED
|
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
|