mirror of
https://github.com/socialwifi/RouterOS-api.git
synced 2025-09-01 15:35:49 +02:00
Add linters.
This commit is contained in:
parent
bd2aaa7559
commit
e1a2eabc08
22 changed files with 82 additions and 54 deletions
|
@ -3,7 +3,6 @@ import re
|
|||
from routeros_api import exceptions
|
||||
from routeros_api import query
|
||||
|
||||
|
||||
response_re = re.compile(rb'^!(re|trap|fatal|done)$')
|
||||
attribute_re = re.compile(rb'^=([^=]+)=(.*)$', re.DOTALL)
|
||||
tag_re = re.compile(rb'^\.tag=(.*)$')
|
||||
|
@ -26,7 +25,6 @@ class ResponseSentence(object):
|
|||
sentence)
|
||||
return response
|
||||
|
||||
|
||||
def parse_attributes(self, serialized_attributes):
|
||||
for serialized in serialized_attributes:
|
||||
attribute_match = attribute_re.match(serialized)
|
||||
|
@ -57,8 +55,8 @@ class CommandSentence(object):
|
|||
formated = [self.path + self.command]
|
||||
for key, value in self.attributes.items():
|
||||
formated.append(b'=' + key + b'=' + value)
|
||||
for query in self.queries:
|
||||
formated.extend(query.get_api_format())
|
||||
for _query in self.queries:
|
||||
formated.extend(_query.get_api_format())
|
||||
if self.tag is not None:
|
||||
formated.append(b'.tag=' + self.tag)
|
||||
return formated
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue