epok-toolkit 1.0.0__py3-none-any.whl → 1.2.0__py3-none-any.whl

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.

@@ -1 +1 @@
1
- from .whatsapp_instanced import send_whatsapp_message
1
+ from .whatsapp_instanced import send_text
@@ -17,6 +17,8 @@ client = WhatsappClient(api_key=API_KEY, server_url=SERVER_URL, instance_name=IN
17
17
  max_retries=3,
18
18
  ignore_result=True, # <-- ¡importante!
19
19
  )
20
- def send_whatsapp_message(number: str, message: str):
20
+ def send_whatsapp_message_async(number: str, message: str):
21
21
  return client.send_text(number, message)
22
22
 
23
+ def send_text(number: str, message: str):
24
+ send_whatsapp_message_async.delay(number, message)
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 = 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.0.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
@@ -0,0 +1,23 @@
1
+ epok_toolkit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ epok_toolkit/apps.py,sha256=O3q3CcucJOHjlYIS0VgbKsbtim2hpng_FxpKEG_MlWs,486
3
+ epok_toolkit/default_settings.py,sha256=hxsRmsAcjk4ar-pRz_X6AI17mJ3192Ljbx-xBuP5rdY,452
4
+ epok_toolkit/email/__init__.py,sha256=pyJwysyVoq6DuYAG72fulsKFoOuAfjw3aBH7FhmYGHc,35
5
+ epok_toolkit/email/email_async.py,sha256=oC0WowWNUpTpXdxo6hJag5gWUaStxI6VBEArEKQxXko,1521
6
+ epok_toolkit/email/engine.py,sha256=IIifqRI9z76pHdrO5oSSZ25aP5txOTAgrj1JuVVPlMY,2387
7
+ epok_toolkit/email/templates.py,sha256=uO3gYn2iiGxcjxioaG066gGPts1m-3C1Gp7XatGgVOg,7578
8
+ epok_toolkit/messaging/__init__.py,sha256=AL9bL5fmVZx3ZvdzBWaVgvBJVnRuyYzrCp13txNTc3Q,41
9
+ epok_toolkit/messaging/whatsapp.py,sha256=TrMSiKzvnhWOotSDEGil1BGgOJ7jLK7h3MXKdW3zCJw,14114
10
+ epok_toolkit/messaging/whatsapp_instanced.py,sha256=NL6TBIGHKIgwwEfu99ay1Ybdv1cpbrSezobUdB2RNGU,729
11
+ epok_toolkit/pdf/__init__.py,sha256=Scb1iOYnVIUEiUVHLNaPmcigyD-jOSBs3ws5RmolMKE,33
12
+ epok_toolkit/pdf/ticket_pdf.py,sha256=ce21N7OyaSQkfZvOL4c0mEFv7XSGajlOzL-gNb8vBro,8989
13
+ epok_toolkit/pdf/fuentes/Kollektif-Bold.ttf,sha256=MiaucCL_aPGhbDl6M0xA2g2nf84MXHGciOd-XSw0XRo,78780
14
+ epok_toolkit/pdf/fuentes/Kollektif-BoldItalic.ttf,sha256=hPMiWYQ0fLFfOKvV_OXFCwAaHnNMYzic_DPiqWPQL5w,71912
15
+ epok_toolkit/pdf/fuentes/Kollektif-Italic.ttf,sha256=1CXPyw43il9u0tQ_7aRzsEaVtg3x3_oJ1vuMMvEaDp8,42048
16
+ epok_toolkit/pdf/fuentes/Kollektif.ttf,sha256=7wTLkVVNUm1giLjIZcWRUH5r2r3o0GjdKic4V1A-pNQ,51128
17
+ epok_toolkit/pdf/plantillas/Ticket_congrats.png,sha256=OSQhVR0j_nLHE6kSJ33BTR-77HM1fNAfJBe2EuX6wVk,157141
18
+ epok_toolkit/pdf/plantillas/Ticket_congrats2.png,sha256=1RBogBdo-8WSMpD3H73HoLgJtr5EC5oVKfOCIWOxPSo,373605
19
+ epok_toolkit-1.2.0.dist-info/licenses/LICENSE,sha256=iLDbGXdLSIOT5OsxzHCvtmxHtonE21GiFlS3LNkug4A,128
20
+ epok_toolkit-1.2.0.dist-info/METADATA,sha256=iEWedgDCQBBVP_UZaclFoQk1SrB0_wKnznFm2DSl_5g,739
21
+ epok_toolkit-1.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
+ epok_toolkit-1.2.0.dist-info/top_level.txt,sha256=Wo72AqIFcfWwBGM5F5iGFw9PrO3WBnTSprFZIJk_pNg,13
23
+ epok_toolkit-1.2.0.dist-info/RECORD,,
@@ -1,17 +0,0 @@
1
- epok_toolkit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- epok_toolkit/apps.py,sha256=O3q3CcucJOHjlYIS0VgbKsbtim2hpng_FxpKEG_MlWs,486
3
- epok_toolkit/default_settings.py,sha256=hxsRmsAcjk4ar-pRz_X6AI17mJ3192Ljbx-xBuP5rdY,452
4
- epok_toolkit/email/__init__.py,sha256=pyJwysyVoq6DuYAG72fulsKFoOuAfjw3aBH7FhmYGHc,35
5
- epok_toolkit/email/email_async.py,sha256=oC0WowWNUpTpXdxo6hJag5gWUaStxI6VBEArEKQxXko,1521
6
- epok_toolkit/email/engine.py,sha256=IIifqRI9z76pHdrO5oSSZ25aP5txOTAgrj1JuVVPlMY,2387
7
- epok_toolkit/email/templates.py,sha256=uO3gYn2iiGxcjxioaG066gGPts1m-3C1Gp7XatGgVOg,7578
8
- epok_toolkit/messaging/__init__.py,sha256=kO7-PTlYLqxeuouqjp_3hqV0aVMosOAMMLh6h7HSBjA,53
9
- epok_toolkit/messaging/whatsapp.py,sha256=TrMSiKzvnhWOotSDEGil1BGgOJ7jLK7h3MXKdW3zCJw,14114
10
- epok_toolkit/messaging/whatsapp_instanced.py,sha256=FsyJNPgAonmo_9EYBGmfh4Ykovn7lXhzDyclyCepKno,627
11
- epok_toolkit/pdf/__init__.py,sha256=Scb1iOYnVIUEiUVHLNaPmcigyD-jOSBs3ws5RmolMKE,33
12
- epok_toolkit/pdf/ticket_pdf.py,sha256=6-QhnL2LCtWZeRIGnuQDeTybjMs39DnzohYx1mPQoPQ,8821
13
- epok_toolkit-1.0.0.dist-info/licenses/LICENSE,sha256=iLDbGXdLSIOT5OsxzHCvtmxHtonE21GiFlS3LNkug4A,128
14
- epok_toolkit-1.0.0.dist-info/METADATA,sha256=j2fxHYN14mUnmjkIdjKL4FB5Hr7DAMqPiEifrLjRWww,739
15
- epok_toolkit-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
- epok_toolkit-1.0.0.dist-info/top_level.txt,sha256=Wo72AqIFcfWwBGM5F5iGFw9PrO3WBnTSprFZIJk_pNg,13
17
- epok_toolkit-1.0.0.dist-info/RECORD,,