Expose plugin metadata in standalone mode loader
This commit is contained in:
parent
f0e2bb3d62
commit
41cbf6d788
2 changed files with 4 additions and 3 deletions
|
@ -115,7 +115,7 @@ else:
|
||||||
main_class = meta.main_class
|
main_class = meta.main_class
|
||||||
bot_module = importlib.import_module(module)
|
bot_module = importlib.import_module(module)
|
||||||
plugin: type[Plugin] = getattr(bot_module, main_class)
|
plugin: type[Plugin] = getattr(bot_module, main_class)
|
||||||
loader = FileSystemLoader(os.path.dirname(args.meta))
|
loader = FileSystemLoader(os.path.dirname(args.meta), meta)
|
||||||
|
|
||||||
log.info(f"Initializing standalone {meta.id} v{meta.version} on maubot {__version__}")
|
log.info(f"Initializing standalone {meta.id} v{meta.version} on maubot {__version__}")
|
||||||
|
|
||||||
|
|
|
@ -18,12 +18,13 @@ from __future__ import annotations
|
||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
from ..loader import BasePluginLoader
|
from ..loader import BasePluginLoader, PluginMeta
|
||||||
|
|
||||||
|
|
||||||
class FileSystemLoader(BasePluginLoader):
|
class FileSystemLoader(BasePluginLoader):
|
||||||
def __init__(self, path: str) -> None:
|
def __init__(self, path: str, meta: PluginMeta) -> None:
|
||||||
self.path = path
|
self.path = path
|
||||||
|
self.meta = meta
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def source(self) -> str:
|
def source(self) -> str:
|
||||||
|
|
Loading…
Reference in a new issue