From 1358241a612980781bc7f80dec67bc8de74a3903 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Sat, 19 Nov 2022 21:48:27 +0100 Subject: Add command to add workspace --- slack/init.py | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'slack/init.py') diff --git a/slack/init.py b/slack/init.py index 8e1a433..ff95f57 100644 --- a/slack/init.py +++ b/slack/init.py @@ -1,5 +1,6 @@ import weechat +from slack.commands import register_commands from slack.config import SlackConfig, SlackWorkspace from slack.shared import shared from slack.task import create_task @@ -17,19 +18,20 @@ def shutdown_cb(): async def init(): - print(shared.workspaces) - if "wee-slack-test" not in shared.workspaces: - shared.workspaces["wee-slack-test"] = SlackWorkspace("wee-slack-test") - shared.workspaces[ - "wee-slack-test" - ].config.api_token.value = weechat.config_get_plugin("api_token") - shared.workspaces[ - "wee-slack-test" - ].config.api_cookies.value = weechat.config_get_plugin("api_cookie") - workspace = shared.workspaces["wee-slack-test"] - print(workspace) - print(workspace.config.slack_timeout.value) - print(shared.config.color.reaction_suffix.value) + pass + # print(shared.workspaces) + # if "wee-slack-test" not in shared.workspaces: + # shared.workspaces["wee-slack-test"] = SlackWorkspace("wee-slack-test") + # shared.workspaces[ + # "wee-slack-test" + # ].config.api_token.value = weechat.config_get_plugin("api_token") + # shared.workspaces[ + # "wee-slack-test" + # ].config.api_cookies.value = weechat.config_get_plugin("api_cookie") + # workspace = shared.workspaces["wee-slack-test"] + # print(workspace) + # print(workspace.config.slack_timeout.value) + # print(shared.config.color.reaction_suffix.value) def main(): @@ -46,4 +48,5 @@ def main(): shared.workspaces = {} shared.config = SlackConfig() shared.config.config_read() + register_commands() create_task(init(), final=True) -- cgit