-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[melobot] Refactor plugin working mechanism & add deprecated removing…
… flags
- Loading branch information
Showing
10 changed files
with
283 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
from .base import Plugin, PluginLifeSpan | ||
# REMOVE: 3.0.0 | ||
from .base import LegacyPlugin as Plugin | ||
from .base import PluginLifeSpan, PluginPlanner | ||
from .ipc import AsyncShare, SyncShare |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
# pylint: disable=invalid-name | ||
from os import listdir as _VAR1 | ||
from pathlib import Path as _VAR2 | ||
from typing import Any as _VAR3 | ||
|
||
from melobot.plugin.load import plugin_get_attr as _VAR4 | ||
from melobot import get_bot as _VAR4 | ||
|
||
_VAR5 = _VAR2(__file__).parent | ||
_VAR6 = set(fname.split(".")[0] for fname in _VAR1(_VAR5)) | ||
_VAR7 = _VAR5.parts[-1] | ||
|
||
|
||
def __getattr__(name: str) -> _VAR3: | ||
if name in _VAR6 or name.startswith("_"): | ||
def __getattr__(_VAR8: str) -> _VAR3: | ||
if _VAR8 in _VAR6 or _VAR8.startswith("_"): | ||
raise AttributeError | ||
return _VAR4(_VAR5.parts[-1], name) | ||
_VAR9 = _VAR4().get_share(_VAR7, _VAR8) | ||
if _VAR9.static: | ||
return _VAR9.get() | ||
return _VAR9 |
Oops, something went wrong.