From acaf2e81719ba160aac3bc7c3c78fc4db3d13f65 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Sat, 29 Oct 2022 16:57:53 +0200 Subject: Use class for shared, so we don't have to change usage when combining --- slack.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'slack.py') diff --git a/slack.py b/slack.py index e47fca1..197e539 100644 --- a/slack.py +++ b/slack.py @@ -4,32 +4,32 @@ import sys import weechat sys.path.append(os.path.dirname(os.path.realpath(__file__))) -from slack import globals as G # pylint: disable=wrong-import-position from slack.config import SlackConfig from slack.main import init # pylint: disable=wrong-import-position +from slack.shared import shared # pylint: disable=wrong-import-position from slack.task import create_task # pylint: disable=wrong-import-position from slack.util import get_callback_name # pylint: disable=wrong-import-position -G.weechat_callbacks = globals() +shared.weechat_callbacks = globals() def shutdown_cb(): - weechat.config_write(G.config.weechat_config.pointer) + weechat.config_write(shared.config.weechat_config.pointer) return weechat.WEECHAT_RC_OK if __name__ == "__main__": if weechat.register( - G.SCRIPT_NAME, - G.SCRIPT_AUTHOR, - G.SCRIPT_VERSION, - G.SCRIPT_LICENSE, - G.SCRIPT_DESC, + shared.SCRIPT_NAME, + shared.SCRIPT_AUTHOR, + shared.SCRIPT_VERSION, + shared.SCRIPT_LICENSE, + shared.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() + shared.weechat_version = int(weechat.info_get("version_number", "") or 0) + shared.workspaces = {} + shared.config = SlackConfig() + shared.config.config_read() create_task(init(), final=True) -- cgit