mirror of
https://github.com/maubot/maubot.git
synced 2024-10-01 01:06:10 -04:00
Compare commits
7 Commits
b11e15117e
...
c6e7a302ae
Author | SHA1 | Date | |
---|---|---|---|
|
c6e7a302ae | ||
|
91f214819a | ||
|
299d8f68c3 | ||
|
a7f31f6175 | ||
|
4f68e20ff7 | ||
|
7759643e93 | ||
|
2c60342cc6 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -13,6 +13,7 @@ __pycache__
|
||||
!example-config.yaml
|
||||
!.pre-commit-config.yaml
|
||||
|
||||
/start
|
||||
logs/
|
||||
plugins/
|
||||
trash/
|
||||
|
18
CHANGELOG.md
18
CHANGELOG.md
@ -1,3 +1,21 @@
|
||||
# v0.5.0 (unreleased)
|
||||
|
||||
* Fixed `main_class` to default to being loaded from the last module instead of
|
||||
the first if a module name is not explicitly specified.
|
||||
* This was already the [documented behavior](https://docs.mau.fi/maubot/dev/reference/plugin-metadata.html),
|
||||
and loading from the first module doesn't make sense due to import order.
|
||||
* Added simple scheduler utility for running background tasks periodically or
|
||||
after a certain delay.
|
||||
* Added testing framework for plugins (thanks to [@abompard] in [#225]).
|
||||
* Changed `mbc build` to ignore directories declared in `modules` that are
|
||||
missing an `__init__.py` file.
|
||||
* Importing the modules at runtime would fail and break the plugin.
|
||||
To include non-code resources outside modules in the mbp archive,
|
||||
use `extra_files` instead.
|
||||
|
||||
[#225]: https://github.com/maubot/maubot/issues/225
|
||||
[@abompard]: https://github.com/abompard
|
||||
|
||||
# v0.4.2 (2023-09-20)
|
||||
|
||||
* Updated Pillow to 10.0.1.
|
||||
|
@ -22,7 +22,7 @@ All setup and usage instructions are located on
|
||||
Matrix room: [#maubot:maunium.net](https://matrix.to/#/#maubot:maunium.net)
|
||||
|
||||
## Plugins
|
||||
A list of plugins can be found at [plugins.maubot.xyz](https://plugins.maubot.xyz/).
|
||||
A list of plugins can be found at [plugins.mau.bot](https://plugins.mau.bot/).
|
||||
|
||||
To add your plugin to the list, send a pull request to <https://github.com/maubot/plugins.maubot.xyz>.
|
||||
|
||||
|
@ -93,10 +93,16 @@ def write_plugin(meta: PluginMeta, output: str | IO) -> None:
|
||||
if os.path.isfile(f"{module}.py"):
|
||||
zip.write(f"{module}.py")
|
||||
elif module is not None and os.path.isdir(module):
|
||||
zipdir(zip, module)
|
||||
if os.path.isfile(f"{module}/__init__.py"):
|
||||
zipdir(zip, module)
|
||||
else:
|
||||
print(
|
||||
Fore.YELLOW
|
||||
+ f"Module {module} is missing __init__.py, skipping"
|
||||
+ Fore.RESET
|
||||
)
|
||||
else:
|
||||
print(Fore.YELLOW + f"Module {module} not found, skipping" + Fore.RESET)
|
||||
|
||||
for pattern in meta.extra_files:
|
||||
for file in glob.iglob(pattern):
|
||||
zip.write(file)
|
||||
|
@ -167,7 +167,7 @@ class ZippedPluginLoader(PluginLoader):
|
||||
if "/" in meta.main_class:
|
||||
self.main_module, self.main_class = meta.main_class.split("/")[:2]
|
||||
else:
|
||||
self.main_module = meta.modules[0]
|
||||
self.main_module = meta.modules[-1]
|
||||
self.main_class = meta.main_class
|
||||
self._file = file
|
||||
|
||||
|
@ -115,7 +115,7 @@ with open(args.meta, "r") as meta_file:
|
||||
if "/" in meta.main_class:
|
||||
module, main_class = meta.main_class.split("/", 1)
|
||||
else:
|
||||
module = meta.modules[0]
|
||||
module = meta.modules[-1]
|
||||
main_class = meta.main_class
|
||||
|
||||
if args.meta != "maubot.yaml" and os.path.dirname(args.meta) != "":
|
||||
|
Loading…
Reference in New Issue
Block a user