added docstrings to all functions and classes

This commit is contained in:
tomaae 2019-12-05 20:42:14 +01:00
parent d1f8a7f56b
commit b2c268a1c0
3 changed files with 33 additions and 17 deletions

View file

@ -76,6 +76,7 @@ class MikrotikAPI:
# error_to_strings
# ---------------------------
def error_to_strings(self, error):
"""Translate error output to error string."""
self.error = "cannot_connect"
if error == "invalid user name or password (6)":
self.error = "wrong_login"
@ -121,6 +122,7 @@ class MikrotikAPI:
# update
# ---------------------------
def update(self, path, param, value, mod_param, mod_value):
"""Modify a parameter"""
response = self.path(path)
if response is None:
return False
@ -145,6 +147,7 @@ class MikrotikAPI:
# run_script
# ---------------------------
def run_script(self, name):
"""Run script"""
response = self.path('/system/script')
if response is None:
return False