Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
luqasz committed Nov 30, 2024
1 parent 333d883 commit f1f1131
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions apicli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,26 @@

"""Command line interface for debugging purpouses."""


import logging
import getpass
import logging
from argparse import ArgumentParser
from sys import stdout, stdin
from select import select
from os import linesep
from select import select
from sys import stdin, stdout

from librouteros import connect
from librouteros.exceptions import TrapError, FatalError
from librouteros.exceptions import FatalError, TrapError

argParser = ArgumentParser(description='mikrotik api cli interface')
argParser.add_argument(
'host', type=str,
help="host to with to connect. may be fqdn, ipv4 or ipv6 address")
argParser.add_argument('-u', '--user', type=str, required=True, help="username")
argParser.add_argument(
'-p', '--port', type=int, default=8728, help="port to connect to (default 8728)")
args = argParser.parse_args()
arg_parser = ArgumentParser(description="mikrotik api cli interface")
arg_parser.add_argument("host", type=str, help="host to with to connect. may be fqdn, ipv4 or ipv6 address")
arg_parser.add_argument("-u", "--user", type=str, required=True, help="username")
arg_parser.add_argument("-p", "--port", type=int, default=8728, help="port to connect to (default 8728)")
args = arg_parser.parse_args()

mainlog = logging.getLogger('librouteros')
mainlog = logging.getLogger("librouteros")
console = logging.StreamHandler(stdout)
mainlog.setLevel(logging.DEBUG)
formatter = logging.Formatter(fmt='%(message)s')
formatter = logging.Formatter(fmt="%(message)s")
console.setFormatter(formatter)
mainlog.addHandler(console)

Expand Down Expand Up @@ -67,10 +63,10 @@ def main():
except KeyboardInterrupt:
pass
except (ConnectionError, FatalError) as e:
print(e)
print(e) # noqa: T201
finally:
api.close()


if __name__ == '__main__':
if __name__ == "__main__":
main()

0 comments on commit f1f1131

Please sign in to comment.