Skip to content

Commit e0ca554

Browse files
Better formatting of devices
1 parent 49ebe59 commit e0ca554

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

helpers/device_serial_id.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,14 @@ def init(mode, tcp_ip='', tcp_port=''):
7373
custom_print(output[0])
7474
custom_print('\n', is_get_time=False)
7575
if device_to_connect is None:
76+
padding = f' {" " * 25}'
7677
for index, device in enumerate(output[1:]):
77-
name = f'{adb} -s {device.split()[0]} shell getprop ro.product.model'
78-
custom_print(
79-
f'{index}. {device.split()[0]} {device.split()[1]} {sp.getoutput(name).strip()}')
78+
serial = device.split()[0]
79+
state = device.split()[1]
80+
name = 'Unknown' if state == 'unauthorized' else sp.getoutput(
81+
f'{adb} -s {device.split()[0]} shell getprop ro.product.model').strip()
82+
custom_print('{}. {:.15s} {:.15s} {}'
83+
.format(index + 1, serial + padding, state + padding, name))
8084

8185
while device_to_connect is None:
8286
device_index = int(custom_input(

non_essentials/DATE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
05/03/2022
1+
06/03/2022

0 commit comments

Comments
 (0)