forked from vbatts/maubot
Pass asyncio event loop and http session to plugin instances
This commit is contained in:
parent
9e066478a9
commit
767885cec7
3 changed files with 16 additions and 7 deletions
|
@ -16,6 +16,8 @@
|
|||
from typing import Type, Optional, TYPE_CHECKING
|
||||
from logging import Logger
|
||||
from abc import ABC, abstractmethod
|
||||
from asyncio import AbstractEventLoop
|
||||
from aiohttp import ClientSession
|
||||
import os.path
|
||||
|
||||
from sqlalchemy.engine.base import Engine
|
||||
|
@ -34,11 +36,15 @@ class Plugin(ABC):
|
|||
client: 'MaubotMatrixClient'
|
||||
id: str
|
||||
log: Logger
|
||||
loop: AbstractEventLoop
|
||||
config: Optional['BaseProxyConfig']
|
||||
|
||||
def __init__(self, client: 'MaubotMatrixClient', plugin_instance_id: str, log: Logger,
|
||||
config: Optional['BaseProxyConfig'], db_base_path: str) -> None:
|
||||
def __init__(self, client: 'MaubotMatrixClient', loop: AbstractEventLoop, http: ClientSession,
|
||||
plugin_instance_id: str, log: Logger, config: Optional['BaseProxyConfig'],
|
||||
db_base_path: str) -> None:
|
||||
self.client = client
|
||||
self.loop = loop
|
||||
self.http = http
|
||||
self.id = plugin_instance_id
|
||||
self.log = log
|
||||
self.config = config
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue