diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2022-10-24 23:15:55 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:52 +0100 |
commit | e635272b39436b100badec940d83f2f0d4ad2e38 (patch) | |
tree | 9cf1f228694505ef82c7d406677209de9d8e382b /slack | |
parent | 9f938758633224f9ddacdbb730bf877a631fea03 (diff) | |
download | wee-slack-e635272b39436b100badec940d83f2f0d4ad2e38.tar.gz |
Move from slack/main.py to slack.py
Having it in slack/main.py doesn't work with combining to one file.
Diffstat (limited to 'slack')
-rw-r--r-- | slack/main.py | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/slack/main.py b/slack/main.py deleted file mode 100644 index 3a4c652..0000000 --- a/slack/main.py +++ /dev/null @@ -1,46 +0,0 @@ -from __future__ import annotations - -import weechat - -from . import globals as G -from .config import SlackConfig, SlackWorkspace -from .task import create_task -from .util import get_callback_name - - -def shutdown_cb(): - weechat.config_write(G.config.weechat_config.pointer) - return weechat.WEECHAT_RC_OK - - -async def init(): - print(G.workspaces) - if "wee-slack-test" not in G.workspaces: - G.workspaces["wee-slack-test"] = SlackWorkspace("wee-slack-test") - G.workspaces[ - "wee-slack-test" - ].config.api_token.value = weechat.config_get_plugin("api_token") - G.workspaces[ - "wee-slack-test" - ].config.api_cookies.value = weechat.config_get_plugin("api_cookie") - workspace = G.workspaces["wee-slack-test"] - print(workspace) - print(workspace.config.slack_timeout.value) - print(G.config.color.reaction_suffix.value) - - -def main(): - if weechat.register( - G.SCRIPT_NAME, - G.SCRIPT_AUTHOR, - G.SCRIPT_VERSION, - G.SCRIPT_LICENSE, - G.SCRIPT_DESC, - get_callback_name(shutdown_cb), - "", - ): - G.weechat_version = int(weechat.info_get("version_number", "") or 0) - G.workspaces = {} - G.config = SlackConfig() - G.config.config_read() - create_task(init(), final=True) |