From c99d572adccc52fed9ae1384feceab049ca24c96 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Thu, 4 Nov 2021 16:19:13 +0000 Subject: [PATCH] Use that bottle Plugin.apply() signature throughout --- src/eddn/Gateway.py | 4 ++-- src/eddn/Monitor.py | 4 ++-- src/eddn/Relay.py | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/eddn/Gateway.py b/src/eddn/Gateway.py index 3ae5463..2648546 100644 --- a/src/eddn/Gateway.py +++ b/src/eddn/Gateway.py @@ -11,7 +11,7 @@ import hashlib import logging import zlib from datetime import datetime -from typing import Dict +from typing import Callable, Dict from urllib.parse import parse_qs import gevent @@ -384,7 +384,7 @@ class EnableCors(object): api = 2 @staticmethod - def apply(fn, context): + def apply(self, fn: Callable, context: str): """ Apply CORS headers to the calling bottle app. diff --git a/src/eddn/Monitor.py b/src/eddn/Monitor.py index feeb0c0..dc7bb5d 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 OrderedDict +from typing import Callable, OrderedDict import gevent import mysql.connector as mariadb @@ -285,7 +285,7 @@ class EnableCors(object): api = 2 @staticmethod - def apply(fn, context): + def apply(self, fn: Callable, context: str): """ Apply a CORS handler. diff --git a/src/eddn/Relay.py b/src/eddn/Relay.py index ecd29f5..3ff289d 100644 --- a/src/eddn/Relay.py +++ b/src/eddn/Relay.py @@ -8,6 +8,7 @@ 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__) @@ -194,7 +195,7 @@ class EnableCors(object): api = 2 @staticmethod - def apply(fn, context): + def apply(self, fn: Callable, context: str): """ Apply a CORS handler.