diff --git a/main.py b/main.py index e18cef8..1df1d4c 100755 --- a/main.py +++ b/main.py @@ -1,20 +1,27 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -import brathuhn, os +import sys, os -import stream_ft,xmpp +cwd = os.getcwd() +sys.path.append(os.path.join(cwd,"sys")) +sys.path.append(os.path.join(cwd,"modules","active")) -import kraken -import get_quote -import logger -import cowsay -import choose -import tantrum -import tell -import last_active -import pen +import brathuhn +modules = [] +files = os.listdir( os.path.join(cwd,"modules","active") ) + +for f in files: + if f.endswith(".py"): + mod = f[:-3] + elif f.endswith(".pyc"): + mod = f[:-4] + if not mod in modules: + modules.append(mod) + +for mod in modules: + __import__(mod) brathuhn.connect_and_join() brathuhn.loop() diff --git a/choose.py b/modules/active/choose.py similarity index 100% rename from choose.py rename to modules/active/choose.py diff --git a/cowsay.py b/modules/active/cowsay.py similarity index 100% rename from cowsay.py rename to modules/active/cowsay.py diff --git a/get_quote.py b/modules/active/get_quote.py similarity index 100% rename from get_quote.py rename to modules/active/get_quote.py diff --git a/kraken.py b/modules/active/kraken.py similarity index 100% rename from kraken.py rename to modules/active/kraken.py diff --git a/last_active.py b/modules/active/last_active.py similarity index 100% rename from last_active.py rename to modules/active/last_active.py diff --git a/logger.py b/modules/active/logger.py similarity index 100% rename from logger.py rename to modules/active/logger.py diff --git a/pen.py b/modules/active/pen.py similarity index 100% rename from pen.py rename to modules/active/pen.py diff --git a/tantrum.py b/modules/active/tantrum.py similarity index 100% rename from tantrum.py rename to modules/active/tantrum.py diff --git a/tell.py b/modules/active/tell.py similarity index 100% rename from tell.py rename to modules/active/tell.py diff --git a/brathuhn.py b/sys/brathuhn.py similarity index 100% rename from brathuhn.py rename to sys/brathuhn.py diff --git a/config.py b/sys/config.py similarity index 100% rename from config.py rename to sys/config.py diff --git a/jingle_ft.py b/sys/jingle_ft.py old mode 100755 new mode 100644 similarity index 100% rename from jingle_ft.py rename to sys/jingle_ft.py diff --git a/quote.py b/sys/quote.py similarity index 100% rename from quote.py rename to sys/quote.py diff --git a/s5b.py b/sys/s5b.py similarity index 100% rename from s5b.py rename to sys/s5b.py diff --git a/stream_ft.py b/sys/stream_ft.py similarity index 100% rename from stream_ft.py rename to sys/stream_ft.py diff --git a/util.py b/sys/util.py similarity index 100% rename from util.py rename to sys/util.py