1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-19 00:17:51 +02:00
This commit is contained in:
Kelly Brazil
2021-10-24 11:21:47 -07:00
parent 1669e6e20c
commit 0313e3f8ca

View File

@ -337,8 +337,7 @@ class _LsUsb():
if char == ' ': if char == ' ':
indent += 1 indent += 1
continue continue
else: break
break
return indent return indent
def _add_attributes(self, line): def _add_attributes(self, line):
@ -487,12 +486,14 @@ class _LsUsb():
' Hub Port Status:': 'hub_port_status' ' Hub Port Status:': 'hub_port_status'
} }
for sec in string_section_map.keys(): for sec_string, section_val in string_section_map.items():
if line.startswith(sec): if line.startswith(sec_string):
self.section = string_section_map[sec] self.section = section_val
self.attribute_value = False self.attribute_value = False
return True return True
return False
def _populate_lists(self, line): def _populate_lists(self, line):
section_list_map = { section_list_map = {
'device_descriptor': self.device_descriptor_list, 'device_descriptor': self.device_descriptor_list,
@ -509,7 +510,7 @@ class _LsUsb():
'hub_descriptor': self.hub_descriptor_list 'hub_descriptor': self.hub_descriptor_list
} }
for sec in section_list_map.keys(): for sec in section_list_map:
if line.startswith(' ') and self.section == sec: if line.startswith(' ') and self.section == sec:
section_list_map[self.section].append(self._add_attributes(line)) section_list_map[self.section].append(self._add_attributes(line))
return True return True
@ -523,6 +524,8 @@ class _LsUsb():
self.device_status_list.append(self._add_device_status_attributes(line)) self.device_status_list.append(self._add_device_status_attributes(line))
return True return True
return False
def _populate_schema(self): def _populate_schema(self):
""" """
Schema: Schema: