Bouncer: Trying out 'Callable' for bottle plugin.apply() type annotation

This commit is contained in:
Athanasius committed 2022-08-18 15:18:01 +01:00
1 parent 1f420a8f3e
commit 485055357b
1 file changed
+3 -2
+3 -2
View File
@@ -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.