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

This commit is contained in:
Athanasius 2021-11-04 16:16:32 +00:00
parent 1f420a8f3e
commit 485055357b
No known key found for this signature in database
GPG Key ID: 8C392035DD80FD62

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.