mirror of
https://github.com/EDCD/EDDN.git
synced 2025-06-13 13:52:20 +03:00
Bouncer: Trying out 'Callable' for bottle plugin.apply() type annotation
This commit is contained in:
parent
1f420a8f3e
commit
485055357b
@ -30,6 +30,7 @@ import argparse
|
|||||||
import logging
|
import logging
|
||||||
import zlib
|
import zlib
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
from typing import Callable
|
||||||
|
|
||||||
import gevent
|
import gevent
|
||||||
import requests
|
import requests
|
||||||
@ -257,7 +258,7 @@ class EnableCors(object):
|
|||||||
name = 'enable_cors'
|
name = 'enable_cors'
|
||||||
api = 2
|
api = 2
|
||||||
|
|
||||||
def apply(self, fn, context):
|
def apply(self, fn: Callable, context: str):
|
||||||
"""
|
"""
|
||||||
Apply CORS headers to the calling bottle app.
|
Apply CORS headers to the calling bottle app.
|
||||||
|
|
||||||
@ -285,7 +286,7 @@ class CustomLogging(object):
|
|||||||
name = 'custom_logging'
|
name = 'custom_logging'
|
||||||
api = 2
|
api = 2
|
||||||
|
|
||||||
def apply(self, fn, context):
|
def apply(self, fn: Callable, context: str):
|
||||||
"""
|
"""
|
||||||
Apply custom logging to bottle request.
|
Apply custom logging to bottle request.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user