diff --git a/src/eddn/Gateway.py b/src/eddn/Gateway.py index daaefeb..aa8e57b 100644 --- a/src/eddn/Gateway.py +++ b/src/eddn/Gateway.py @@ -1,3 +1,4 @@ + # coding: utf8 """ @@ -11,7 +12,7 @@ import hashlib import logging import zlib from datetime import datetime -from typing import Callable, Dict +from typing import Dict import gevent import simplejson @@ -353,8 +354,8 @@ def apply_cors() -> None: """ response.set_header( 'Access-Control-Allow-Origin', - '*' - ) + '*' + ) response.set_header( 'Access-Control-Allow-Methods', 'GET, POST, PUT, OPTIONS' @@ -364,6 +365,7 @@ def apply_cors() -> None: 'Origin, Accept, Content-Type, X-Requested-With, X-CSRF-Token' ) + def main() -> None: """Handle setting up and running the bottle app.""" cl_args = parse_cl_args() diff --git a/src/eddn/Monitor.py b/src/eddn/Monitor.py index 823b7a8..36ec2ad 100644 --- a/src/eddn/Monitor.py +++ b/src/eddn/Monitor.py @@ -5,7 +5,7 @@ import collections import datetime import zlib from threading import Thread -from typing import Callable, OrderedDict +from typing import OrderedDict import gevent import mysql.connector as mariadb diff --git a/src/eddn/Relay.py b/src/eddn/Relay.py index d158bb5..131b497 100644 --- a/src/eddn/Relay.py +++ b/src/eddn/Relay.py @@ -8,7 +8,6 @@ import time import uuid import zlib from threading import Thread -from typing import Callable # Logging has to be configured first before we do anything. logger = logging.getLogger(__name__) @@ -26,7 +25,7 @@ logger.info('Made logger') import gevent import simplejson import zmq.green as zmq -from bottle import Bottle, request, response +from bottle import Bottle, response from gevent import monkey from eddn.conf.Settings import Settings, load_config @@ -109,7 +108,7 @@ class Relay(Thread): return hashlib.sha1(f"{self.uploader_nonce!r}-{uploader.encode}".encode('utf8')).hexdigest() - def run(self) -> None: # noqa: CCR001 + def run(self) -> None: """Handle receiving messages from Gateway and passing them on.""" # These form the connection to the Gateway daemon(s) upstream. context = zmq.Context()