aboutsummaryrefslogtreecommitdiffstats
path: root/slack/main.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2022-10-24 21:48:24 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-18 11:32:52 +0100
commitfed1898bb75f2c3f0297cf7228c9d86adef57b78 (patch)
treee89f562226c038bacb1aa33a8a3a3026dcd328af /slack/main.py
parent4b004a356aec12eb59fb4c5a208c21d3817ef9d7 (diff)
downloadwee-slack-fed1898bb75f2c3f0297cf7228c9d86adef57b78.tar.gz
Move main file out of directory
Diffstat (limited to 'slack/main.py')
-rw-r--r--slack/main.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/slack/main.py b/slack/main.py
index 5ab431c..3a4c652 100644
--- a/slack/main.py
+++ b/slack/main.py
@@ -1,17 +1,11 @@
from __future__ import annotations
-import os
-import sys
-
import weechat
-sys.path.append(os.path.dirname(os.path.realpath(__file__)))
-import globals as G # pylint: disable=wrong-import-position
-from config import SlackConfig, SlackWorkspace # pylint: disable=wrong-import-position
-from task import create_task # pylint: disable=wrong-import-position
-from util import get_callback_name # pylint: disable=wrong-import-position
-
-G.weechat_callbacks = globals()
+from . import globals as G
+from .config import SlackConfig, SlackWorkspace
+from .task import create_task
+from .util import get_callback_name
def shutdown_cb():
@@ -35,7 +29,7 @@ async def init():
print(G.config.color.reaction_suffix.value)
-if __name__ == "__main__":
+def main():
if weechat.register(
G.SCRIPT_NAME,
G.SCRIPT_AUTHOR,