Commit 844505d5 authored by matograine's avatar matograine

should be working : retrieving and block creating more than 10 pages

parent 8cebdbb6
......@@ -20,7 +20,7 @@ if argv[1] == "generate":
amount = float(argv[2])
pages = int(argv[3])
delay = float(argv[4])
Creating (amount, pages, delay). create()
Creating (amount, pages, delay).create()
elif argv[1] == "retrieve":
file = argv[2]
......
......@@ -8,6 +8,9 @@ from utils.silkaj.tools import coroutine
import os
import json
MAX_PAGES_I_CAN_GENERATE = 10
# Generate and fill Tips
class Creating:
"""Generating, filling wallets"""
......@@ -27,10 +30,11 @@ class Creating:
def create(self):
""" Generating, filling wallets."""
# self.tip_date()
Generator(self.output, self.wallets, self.pages).generate()
Transfer(self.amount, self.pages, self.wallets, self.output, self.delay).transfer()
if self.pages < MAX_PAGES_I_CAN_GENERATE:
Generator(self.output, self.wallets, 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 !")
# @coroutine
# async def create(self):
# """ Generating, filling wallets."""
......
......@@ -51,8 +51,11 @@ class Retrieve():
while len(retrieving_wallets) != 0:
issuers, key_list, amount, listinput = list(), list(), 0, list()
wallet_list = list()
for n in range (0,MAX_ISSUERS):
wallet_list.append (retrieving_wallets[n])
if len(retrieving_wallets) > MAX_ISSUERS:
for n in range (0,MAX_ISSUERS):
wallet_list.append (retrieving_wallets[n])
else :
wallet_list = retrieving_wallets
issuers_keys = Retrieve.get_key_list(wallet_list)
#créer les listes : clefs, issuers, amount
# while a < len(issuers_keys):
......@@ -76,8 +79,9 @@ class Retrieve():
"",
)
issuers, key_list, amount, listinput = list(), list(), 0, list()
for n in range (0,MAX_ISSUERS):
retrieving_wallets.pop(0)
if not len(retrieving_wallets) == 0:
for n in range (0,MAX_ISSUERS):
retrieving_wallets.pop(0)
# closing the client instance
await ClientInstance().client.close()
......
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