forked from Telefonica/HomePWN
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqr_reader.py
More file actions
23 lines (19 loc) · 909 Bytes
/
qr_reader.py
File metadata and controls
23 lines (19 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from utils.custom_print import print_info, print_ok, print_error, print_body, print_ok_raw
from prompt_toolkit import print_formatted_text, HTML
from utils.color_palette import ColorSelected
def display_qr(qr_read, verbose):
"""QR util method to display
Args:
qr_read ([Reg]): Data of the qr read
verbose (Boolean): To display mor info
"""
color = ColorSelected().theme.confirm
print(color)
print_ok_raw(f"Found {len(qr_read)} registries")
for idx, reg in enumerate(qr_read):
print_info(f"==== Reg {idx} ====")
print_formatted_text(HTML(f"<{color}>Data:</{color}> {reg.data}"))
if(verbose):
print_formatted_text(HTML(f"<{color}>Type:</{color}> {reg.type}"))
print_formatted_text(HTML(f"<{color}>Rect:</{color}> {reg.rect}"))
print_formatted_text(HTML(f"<{color}>Polygon:</{color}> {reg.polygon}"))