From 485055357ba87d92cf0e7a2bcb92f80903fa002b Mon Sep 17 00:00:00 2001 From: Athanasius Date: Thu, 4 Nov 2021 16:16:32 +0000 Subject: [PATCH] Bouncer: Trying out 'Callable' for bottle plugin.apply() type annotation --- src/eddn/Bouncer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/eddn/Bouncer.py b/src/eddn/Bouncer.py index 652d3da..ce823e6 100644 --- a/src/eddn/Bouncer.py +++ b/src/eddn/Bouncer.py @@ -30,6 +30,7 @@ import argparse import logging import zlib from datetime import datetime +from typing import Callable import gevent import requests @@ -257,7 +258,7 @@ class EnableCors(object): name = 'enable_cors' api = 2 - def apply(self, fn, context): + def apply(self, fn: Callable, context: str): """ Apply CORS headers to the calling bottle app. @@ -285,7 +286,7 @@ class CustomLogging(object): name = 'custom_logging' api = 2 - def apply(self, fn, context): + def apply(self, fn: Callable, context: str): """ Apply custom logging to bottle request.