Commit 0a2be1b4 authored by matograine's avatar matograine

[enh] write amount on the pourboire

parent 610e3663
......@@ -31,7 +31,7 @@ class Creating:
def create(self):
""" Generating, filling wallets."""
if self.pages < MAX_PAGES_I_CAN_GENERATE:
Generator(self.output, self.wallets, self.pages).generate()
Generator(self.output, self.wallets, self.amount, self.pages).generate()
Transfer(self.amount, self.pages, self.wallets, self.output, self.delay).transfer()
else:
print ("Sorry, Ğ1Pourboire can generate maximum 10 pages at once. For now !")
......
......@@ -26,10 +26,11 @@ import qrcode
class Generator:
"""Generate some wallets, create the pdf to print"""
def __init__(self, output, wallets, pages=1):
def __init__(self, output, wallets, amount, pages=1):
self.pages = pages
self.output = output
self.wallets = wallets
self.amount = amount
self.c = None
def generate(self):
......@@ -56,6 +57,11 @@ class Generator:
recto.paste(qr_pub.resize((200, 200)), (435, 15)) # 36))
# Setting font
font = ImageFont.truetype("objects/Roboto-Medium.ttf", 18)
# Writing amount
if self.amount >= 0 :
draw = ImageDraw.Draw(recto)
txt = "\n".join([str(self.amount) + " Ğ1"])
draw.text((1090, 150), txt, (0, 0, 0), font=ImageFont.truetype("objects/Roboto-Medium.ttf", 30))
# Writing public key
draw = ImageDraw.Draw(recto)
txt = "\n".join([key.pubkey[i : i + 10] for i in range(0, len(key.pubkey), 10)])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment