1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-15 01:24:29 +02:00

update comments

This commit is contained in:
Kelly Brazil
2021-10-12 22:51:45 -06:00
parent 9e9e2c3628
commit ba75989a24

View File

@ -143,13 +143,12 @@ class _LsUsb():
self.section = '' self.section = ''
return True return True
# bus informatin is on the same line so need to extract data immediately and set indexes
if line.startswith('Bus '): if line.startswith('Bus '):
self.section = 'bus' self.section = 'bus'
self.bus_idx += 1 self.bus_idx += 1
self.interface_descriptor_idx = -1 self.interface_descriptor_idx = -1
self.endpoint_descriptor_idx = -1 self.endpoint_descriptor_idx = -1
# bus informatin is on the same line so need to extract data immediately
line_split = line.strip().split(maxsplit=6) line_split = line.strip().split(maxsplit=6)
self.bus_list.append( self.bus_list.append(
{ {
@ -164,21 +163,22 @@ class _LsUsb():
) )
return True return True
# This section is a list, so need to update indexes
if line.startswith(' Interface Descriptor:'): if line.startswith(' Interface Descriptor:'):
self.section = 'interface_descriptor' self.section = 'interface_descriptor'
self.interface_descriptor_idx += 1 self.interface_descriptor_idx += 1
self.endpoint_descriptor_idx = -1 self.endpoint_descriptor_idx = -1
return True return True
# This section is a list, so need to update the index
if line.startswith(' Endpoint Descriptor:'): if line.startswith(' Endpoint Descriptor:'):
self.section = 'endpoint_descriptor' self.section = 'endpoint_descriptor'
self.endpoint_descriptor_idx += 1 self.endpoint_descriptor_idx += 1
return True return True
# some device status information is displayed on the initial line so need to extract immediately
if line.startswith('Device Status:'): if line.startswith('Device Status:'):
self.section = 'device_status' self.section = 'device_status'
# some device status information is displayed on the initial line so need to extract immediately
line_split = line.strip().split(':', maxsplit=1) line_split = line.strip().split(':', maxsplit=1)
self.device_status_list.append( self.device_status_list.append(
{ {
@ -193,7 +193,7 @@ class _LsUsb():
) )
return True return True
# get the rest of the sections # set the rest of the sections
string_section_map = { string_section_map = {
'Device Descriptor:': 'device_descriptor', 'Device Descriptor:': 'device_descriptor',
' Configuration Descriptor:': 'configuration_descriptor', ' Configuration Descriptor:': 'configuration_descriptor',