flake8: minor cleanups

This commit is contained in:
Athanasius 2021-11-07 15:41:26 +00:00
parent 5bc06ccdc5
commit ef84dc0579
3 changed files with 8 additions and 7 deletions

View File

@ -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
from urllib.parse import parse_qs
import gevent
@ -385,8 +386,8 @@ def apply_cors() -> None:
"""
response.set_header(
'Access-Control-Allow-Origin',
'*'
)
'*'
)
response.set_header(
'Access-Control-Allow-Methods',
'GET, POST, PUT, OPTIONS'
@ -396,6 +397,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()

View File

@ -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

View File

@ -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()