decorators.line_handler_decorator -> decorators.handler_decorator

This commit is contained in:
jesopo 2020-03-19 11:47:18 +00:00
parent 2626cdb7a1
commit 6b12f3290f
2 changed files with 5 additions and 5 deletions

View File

@ -1,11 +1,11 @@
from typing import Any, Dict, List
def line_handler_decorator(d: Dict[str, List[Any]]):
def line_handler(command: str):
def handler_decorator(d: Dict[str, List[Any]]):
def _handler(command: str):
def _(func: Any):
if not command in d:
d[command] = []
d[command].append(func)
return func
return _
return line_handler
return _handler

View File

@ -7,12 +7,12 @@ from .user import User
from .channel import Channel
from .channel_user import ChannelUser
from .isupport import ISupport
from .decorators import line_handler_decorator
from .decorators import handler_decorator
from .casemap import casefold
from .emit import *
LINE_HANDLERS: Dict[str, List[Callable[["Server", Line], Emits]]] = {}
line_handler = line_handler_decorator(LINE_HANDLERS)
line_handler = handler_decorator(LINE_HANDLERS)
class ServerException(Exception):
pass