Skip to content

Commit

Permalink
Fix quotes.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus authored Apr 29, 2021
1 parent d325b0f commit 7881855
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions compal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,32 +240,32 @@ def system_info(self):
res = self.xml_getter(GetFunction.CM_SYSTEM_INFO, {})
xml = etree.fromstring(res.content, parser=parser)

cm_docsis_mode = xml.find('cm_docsis_mode')
cm_docsis_mode = xml.find("cm_docsis_mode")
if cm_docsis_mode is not None:
system_info.docsis_mode = cm_docsis_mode.text

cm_hardware_version = xml.find('cm_hardware_version')
cm_hardware_version = xml.find("cm_hardware_version")
if cm_hardware_version is not None:
system_info.hardware_version = cm_hardware_version.text

cm_mac_addr = xml.find('cm_mac_addr')
cm_mac_addr = xml.find("cm_mac_addr")
if cm_mac_addr is not None:
system_info.mac_address = cm_mac_addr.text

cm_serial_number = xml.find('cm_serial_number')
cm_serial_number = xml.find("cm_serial_number")
if cm_serial_number is not None:
system_info.serial_number = cm_serial_number.text

cm_system_uptime = xml.find('cm_system_uptime')
cm_system_uptime = xml.find("cm_system_uptime")
if cm_system_uptime is not None:
match = re.match(r'^(\d+)day(?:\(s\))?(\d+)h?\:(\d+)m?\:(\d+)s?$', cm_system_uptime.text)
match = re.match(r"^(\d+)day(?:\(s\))?(\d+)h?\:(\d+)m?\:(\d+)s?$", cm_system_uptime.text)
days = int(match[1])
hours = int(match[2])
minutes = int(match[3])
seconds = int(match[4])
system_info.uptime = ((days * 24 + hours) * 60 + minutes) * 60 + seconds

cm_network_access = xml.find('cm_network_access')
cm_network_access = xml.find("cm_network_access")
if cm_network_access is not None:
system_info.network_access = cm_network_access.text

Expand Down

0 comments on commit 7881855

Please sign in to comment.