-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
when i have first index 0: and it have NAME
/dev/disk2
#: TYPE NAME SIZE IDENTIFIER
0: Apple_HFS OSX1010 *49.9 GB disk2
try:
dev = line[4]
size = line[2].lstrip('*')
unit = line[3]
except IndexError:
dev = line[3]
size = line[1]
unit = line[2]
try
for line2 in line:
match = re.search('disk', line2)
if match:
break
else:
idx = idx +1
dev = line[idx]
unit = line[idx-1]
size = line[idx-2].lstrip('*')
get the last ,first.
Metadata
Metadata
Assignees
Labels
No labels
