added Notifier impl

This commit is contained in:
əlemi 2022-01-19 01:22:07 +01:00
parent 65b66eaf14
commit 6ed4c8e7e1

24
treepuncher/notifier.py Normal file
View file

@ -0,0 +1,24 @@
from typing import Callable, List
class Notifier:
_report_functions : List[Callable]
def __init__(self):
self._report_functions = []
def register(self, fn:Callable):
self._report_functions.append(fn)
return fn
def report(self) -> str:
return '\n'.join(fn() for fn in self._report_functions)
def notify(self, text, **kwargs):
print(text)
async def initialize(self, _client:'Treepuncher'):
pass
async def cleanup(self, _client:'Treepuncher'):
pass