-
Notifications
You must be signed in to change notification settings - Fork 0
/
screen.py
61 lines (51 loc) · 1.78 KB
/
screen.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#Dependencias del proyecto - pip install -r requirements.txt para instalar las dependencias.
import os
import pyfiglet
from termcolor import colored
import qrcode
import time
# Clase para la pantalla
class Screen:
def __init__(self):
self.clear()
self.print_banner()
@staticmethod
# Método para limpiar la pantalla
def clear():
os.system('cls')
@staticmethod
# Método para imprimir el banner
def print_banner():
ascii_banner = pyfiglet.figlet_format("ATMIQ", font="broadway")
print(colored(ascii_banner, "green"))
@staticmethod
# Método para imprimir un mensaje
def print_message(message, color="green"):
print(colored(message, color), '\n')
@staticmethod
# Método para imprimir un mensaje de error
def print_error(message, color="red"):
print(colored(message, color))
@staticmethod
# Método para imprimir un QR
def print_qr_code(data):
qr = qrcode.QRCode()
qr.add_data(data)
qr.make()
qr.print_ascii()
@staticmethod
# Método para imprimir un mensaje de espera
def wait_for_cash():
# Mensaje de espera
print(colored("Espere mientras se procesa su transacción...", "green"))
time.sleep(1)
# Animación de espera
animation = "|/-\\"
for i in range(10):
time.sleep(0.2)
print("\r" + colored("Retirando dinero " + animation[i % len(animation)], "green"), end="")
print("\r" + colored("Retirando dinero ", "green"), end="")
time.sleep(0.2)
# Limpiar pantalla
os.system('cls')
print("\n" + colored("[📤] Retire su dinero del compartimiento.", "green"))