Add Cloudron packaging for Maubot
This commit is contained in:
27
maubot-src/maubot/cli/res/plugin.py.j2
Normal file
27
maubot-src/maubot/cli/res/plugin.py.j2
Normal file
@@ -0,0 +1,27 @@
|
||||
from typing import Type
|
||||
{% if config %}
|
||||
from mautrix.util.config import BaseProxyConfig, ConfigUpdateHelper
|
||||
{% endif %}
|
||||
from maubot import Plugin
|
||||
{% if config %}
|
||||
|
||||
class Config(BaseProxyConfig):
|
||||
def do_update(self, helper: ConfigUpdateHelper) -> None:
|
||||
helper.copy("example_1")
|
||||
helper.copy("example_2.list")
|
||||
helper.copy("example_2.value")
|
||||
{% endif %}
|
||||
|
||||
class {{ name }}(Plugin):
|
||||
async def start(self) -> None:{% if config %}
|
||||
self.config.load_and_update()
|
||||
self.log.debug("Loaded %s from config example 2", self.config["example_2.value"]){% else %}
|
||||
pass{% endif %}
|
||||
|
||||
async def stop(self) -> None:
|
||||
pass
|
||||
{% if config %}
|
||||
@classmethod
|
||||
def get_config_class(cls) -> Type[BaseProxyConfig]:
|
||||
return Config
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user