flake8: minor cleanups

# Conflicts:
#	src/eddn/Gateway.py
This commit is contained in:
Athanasius 2022-08-18 15:18:48 +01:00
parent 7fe2e8880a
commit 5e51c604a4
No known key found for this signature in database
GPG Key ID: 8C392035DD80FD62
3 changed files with 8 additions and 7 deletions

View File

@ -1,3 +1,4 @@
# coding: utf8 # coding: utf8
""" """
@ -11,7 +12,7 @@ import hashlib
import logging import logging
import zlib import zlib
from datetime import datetime from datetime import datetime
from typing import Callable, Dict from typing import Dict
import gevent import gevent
import simplejson import simplejson
@ -353,8 +354,8 @@ def apply_cors() -> None:
""" """
response.set_header( response.set_header(
'Access-Control-Allow-Origin', 'Access-Control-Allow-Origin',
'*' '*'
) )
response.set_header( response.set_header(
'Access-Control-Allow-Methods', 'Access-Control-Allow-Methods',
'GET, POST, PUT, OPTIONS' 'GET, POST, PUT, OPTIONS'
@ -364,6 +365,7 @@ def apply_cors() -> None:
'Origin, Accept, Content-Type, X-Requested-With, X-CSRF-Token' 'Origin, Accept, Content-Type, X-Requested-With, X-CSRF-Token'
) )
def main() -> None: def main() -> None:
"""Handle setting up and running the bottle app.""" """Handle setting up and running the bottle app."""
cl_args = parse_cl_args() cl_args = parse_cl_args()

View File

@ -5,7 +5,7 @@ import collections
import datetime import datetime
import zlib import zlib
from threading import Thread from threading import Thread
from typing import Callable, OrderedDict from typing import OrderedDict
import gevent import gevent
import mysql.connector as mariadb import mysql.connector as mariadb

View File

@ -8,7 +8,6 @@ import time
import uuid import uuid
import zlib import zlib
from threading import Thread from threading import Thread
from typing import Callable
# Logging has to be configured first before we do anything. # Logging has to be configured first before we do anything.
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -26,7 +25,7 @@ logger.info('Made logger')
import gevent import gevent
import simplejson import simplejson
import zmq.green as zmq import zmq.green as zmq
from bottle import Bottle, request, response from bottle import Bottle, response
from gevent import monkey from gevent import monkey
from eddn.conf.Settings import Settings, load_config 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() 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.""" """Handle receiving messages from Gateway and passing them on."""
# These form the connection to the Gateway daemon(s) upstream. # These form the connection to the Gateway daemon(s) upstream.
context = zmq.Context() context = zmq.Context()