Skip to content

Commit

Permalink
Adjusted local variables to pass lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
ushiboy committed Sep 15, 2024
1 parent 5dac01c commit d17bd4f
Showing 1 changed file with 14 additions and 24 deletions.
38 changes: 14 additions & 24 deletions nmcli/data/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,31 +39,21 @@ def to_json(self):

@classmethod
def parse(cls, text: str) -> General:
#pattern = r'^([\S\s]+)\s{2}(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s*'

state_r = r'(?P<state>.+)'
connectivity_r = r'(?P<connectivity>\S+)'
wifi_hw_r = r'(?P<wifi_hw>\S+)'
wifi_r = r'(?P<wifi>\S+)'
wwan_hw_r = r'(?P<wwan_hw>\S+)'
wwan_r = r'(?P<wwan>\S+)'
metered_r = r'(?: (?P<metered>.+)?)?'

pattern = (
r'^'
+ state_r
+ r' '
+ connectivity_r
+ r'\s+'
+ wifi_hw_r
+ r' '
+ wifi_r
+ r' '
+ wwan_hw_r
+ r' '
+ wwan_r
+ metered_r
+ r'$'
r'^'
+ r'(?P<state>.+)'
+ r' '
+ r'(?P<connectivity>\S+)'
+ r'\s+'
+ r'(?P<wifi_hw>\S+)'
+ r' '
+ r'(?P<wifi>\S+)'
+ r' '
+ r'(?P<wwan_hw>\S+)'
+ r' '
+ r'(?P<wwan>\S+)'
+ r'(?: (?P<metered>.+)?)?'
+ r'$'
)

m = re.search(pattern, text)
Expand Down

0 comments on commit d17bd4f

Please sign in to comment.