From 0313e3f8ca0e22e1575192d765d5afedf48e94df Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Sun, 24 Oct 2021 11:21:47 -0700 Subject: [PATCH] linting --- jc/parsers/lsusb.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/jc/parsers/lsusb.py b/jc/parsers/lsusb.py index 970888f5..e2fb6a31 100644 --- a/jc/parsers/lsusb.py +++ b/jc/parsers/lsusb.py @@ -337,8 +337,7 @@ class _LsUsb(): if char == ' ': indent += 1 continue - else: - break + break return indent def _add_attributes(self, line): @@ -487,12 +486,14 @@ class _LsUsb(): ' Hub Port Status:': 'hub_port_status' } - for sec in string_section_map.keys(): - if line.startswith(sec): - self.section = string_section_map[sec] + for sec_string, section_val in string_section_map.items(): + if line.startswith(sec_string): + self.section = section_val self.attribute_value = False return True + return False + def _populate_lists(self, line): section_list_map = { 'device_descriptor': self.device_descriptor_list, @@ -509,7 +510,7 @@ class _LsUsb(): '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: section_list_map[self.section].append(self._add_attributes(line)) return True @@ -523,6 +524,8 @@ class _LsUsb(): self.device_status_list.append(self._add_device_status_attributes(line)) return True + return False + def _populate_schema(self): """ Schema: