diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2022-10-29 16:57:53 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:52 +0100 |
commit | acaf2e81719ba160aac3bc7c3c78fc4db3d13f65 (patch) | |
tree | a23c4c04ac63987312ce2ff9bb6fc1351c887dfe /slack.py | |
parent | cdf3cfe4a2ed8a340ac1a8404e7cd7e604fe3857 (diff) | |
download | wee-slack-acaf2e81719ba160aac3bc7c3c78fc4db3d13f65.tar.gz |
Use class for shared, so we don't have to change usage when combining
Diffstat (limited to 'slack.py')
-rw-r--r-- | slack.py | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -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) |