]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/modules/__init__.py
Merge pull request #11 from udacity/make_faq_settings_translatable
[osqa.git] / forum / modules / __init__.py
index 976d9eb448a05fd2b2fa78e741ee9e4c59ae8993..f1ad7d96bb167a936ea87756b8dfb695a7384cf4 100644 (file)
@@ -1,28 +1,15 @@
-import os
 import types
 import logging
 
-MODULES_PACKAGE = 'forum_modules'
+from django.conf import settings
 
-MODULES_FOLDER = None
-MODULE_LIST = []
-
-
-def init_modules_engine(site_src_root, disabled_modules):
-    MODULES_FOLDER = os.path.join(site_src_root, MODULES_PACKAGE)
-
-    MODULE_LIST.extend(filter(lambda m: getattr(m, 'CAN_USE', True), [
-            __import__('forum_modules.%s' % f, globals(), locals(), ['forum_modules'])
-            for f in os.listdir(MODULES_FOLDER)
-            if os.path.isdir(os.path.join(MODULES_FOLDER, f)) and
-               os.path.exists(os.path.join(MODULES_FOLDER, "%s/__init__.py" % f)) and
-               not f in disabled_modules
-    ]))
+def get_modules_folder():
+    return get_modules_folder.value
 
 def get_modules_script(script_name):
     all = []
 
-    for m in MODULE_LIST:
+    for m in settings.MODULE_LIST:
         if hasattr(m, script_name):
             all.append(getattr(m, script_name))
             continue