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.

Files changed (30) hide show
  1. epok_toolkit-1.2.0/MANIFEST.in +7 -0
  2. {epok_toolkit-1.1.0/epok_toolkit.egg-info → epok_toolkit-1.2.0}/PKG-INFO +1 -1
  3. epok_toolkit-1.2.0/epok_toolkit/pdf/fuentes/Kollektif-Bold.ttf +0 -0
  4. epok_toolkit-1.2.0/epok_toolkit/pdf/fuentes/Kollektif-BoldItalic.ttf +0 -0
  5. epok_toolkit-1.2.0/epok_toolkit/pdf/fuentes/Kollektif-Italic.ttf +0 -0
  6. epok_toolkit-1.2.0/epok_toolkit/pdf/fuentes/Kollektif.ttf +0 -0
  7. epok_toolkit-1.2.0/epok_toolkit/pdf/plantillas/Ticket_congrats.png +0 -0
  8. epok_toolkit-1.2.0/epok_toolkit/pdf/plantillas/Ticket_congrats2.png +0 -0
  9. {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/pdf/ticket_pdf.py +7 -3
  10. {epok_toolkit-1.1.0 → epok_toolkit-1.2.0/epok_toolkit.egg-info}/PKG-INFO +1 -1
  11. {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit.egg-info/SOURCES.txt +7 -1
  12. {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/pyproject.toml +1 -1
  13. epok_toolkit-1.1.0/MANIFEST.in +0 -4
  14. {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/LICENSE +0 -0
  15. {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/README.md +0 -0
  16. {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/__init__.py +0 -0
  17. {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/apps.py +0 -0
  18. {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/default_settings.py +0 -0
  19. {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/email/__init__.py +0 -0
  20. {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/email/email_async.py +0 -0
  21. {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/email/engine.py +0 -0
  22. {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/email/templates.py +0 -0
  23. {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/messaging/__init__.py +0 -0
  24. {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/messaging/whatsapp.py +0 -0
  25. {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/messaging/whatsapp_instanced.py +0 -0
  26. {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit/pdf/__init__.py +0 -0
  27. {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit.egg-info/dependency_links.txt +0 -0
  28. {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit.egg-info/requires.txt +0 -0
  29. {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/epok_toolkit.egg-info/top_level.txt +0 -0
  30. {epok_toolkit-1.1.0 → epok_toolkit-1.2.0}/setup.cfg +0 -0
@@ -0,0 +1,7 @@
1
+ include README.md
2
+ include LICENSE
3
+
4
+
5
+ # Incluye fuentes y plantillas de PDF
6
+ recursive-include epok_toolkit/pdf/fuentes *.ttf
7
+ recursive-include epok_toolkit/pdf/plantillas *.png
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: epok-toolkit
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: A toolkit for building Django applications with Celery support
5
5
  Author-email: Fernando Leon Franco <fernanlee2131@gmail.com>
6
6
  License: MIT
@@ -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 = os.path.join(plantillas, "Ticket_congrats.png")
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
- self.img = Image.open(Config.plantilla_path)
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
- self.c.drawImage(ImageReader(Config.plantilla_path), 0, 0, width=self.width, height=self.height, mask='auto')
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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: epok-toolkit
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: A toolkit for building Django applications with Celery support
5
5
  Author-email: Fernando Leon Franco <fernanlee2131@gmail.com>
6
6
  License: MIT
@@ -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.1.0"
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" }
@@ -1,4 +0,0 @@
1
- include README.md
2
- include LICENSE
3
- recursive-include epok_toolkit/email/templates *
4
-
File without changes
File without changes
File without changes