From fabbc3ac7a6a39dbb6c44512ec4bf17ac2745126 Mon Sep 17 00:00:00 2001 From: Noah Date: Sat, 9 Jul 2022 19:03:31 +0100 Subject: chore: Reformat code --- discord/utils/event_emitter.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'discord/utils/event_emitter.py') diff --git a/discord/utils/event_emitter.py b/discord/utils/event_emitter.py index 08b6060..7911326 100644 --- a/discord/utils/event_emitter.py +++ b/discord/utils/event_emitter.py @@ -1,18 +1,19 @@ import asyncio from typing import Optional, Coroutine, Any, Callable, Dict -class EventEmitter(): - def __init__(self, loop: Optional[asyncio.AbstractEventLoop]=None): + +class EventEmitter: + def __init__(self, loop: Optional[asyncio.AbstractEventLoop] = None): self.listeners: Dict[str, Optional[Callable[..., Coroutine[Any, Any, Any]]]] = {} self.loop = loop if loop else asyncio.get_event_loop() - def add_listener(self, event_name: str, func: Optional[Callable[..., Coroutine[Any, Any, Any]]]=None): + def add_listener(self, event_name: str, func: Optional[Callable[..., Coroutine[Any, Any, Any]]] = None): if not self.listeners.get(event_name, None): self.listeners[event_name] = {func} else: self.listeners[event_name].add(func) - def remove_listener(self, event_name: str, func: Optional[Callable[..., Coroutine[Any, Any, Any]]]=None): + def remove_listener(self, event_name: str, func: Optional[Callable[..., Coroutine[Any, Any, Any]]] = None): self.listeners[event_name].remove(func) if len(self.listeners[event_name]) == 0: del self.listeners[event_name] -- cgit 1.4.1-2-gfad0