Commit fda4b6fb by Piotr Mitros

Moved from __import__ to more robust/cleaner import_module

parent 4f820c5f
......@@ -154,21 +154,6 @@ useful for chaining analytics.
mitmako) or importing. We should figure out a better way to handle
this.
Target markets
--------------
The analytics has several target markets:
1. Internal system use. As we build out infrastructure for intelligent
tutoring, partnering students into small groups, etc., we need to do
analysis on student interactions with the system.
2. Marketing. Numbers to figure out student lifecycle.
3. Instructors. Numbers to figure out who students are, and how to
improve the courses.
4. Product.
5. Students.
6. Board of directors, reporters, etc.
Modes of operation
------------------
......
import helpers
modules = helpers.import_view_modules()
from importlib import import_module
import inspect
from pymongo import MongoClient
......@@ -17,7 +18,7 @@ def import_view_modules():
top_level_modules = settings.INSTALLED_ANALYTICS_MODULES
module_names = []
for module in top_level_modules:
mod = __import__(module)
mod = import_module(module)
submodules = []
try:
submodules = mod.modules_to_import # I'd like to deprecate this syntax
......@@ -26,7 +27,7 @@ def import_view_modules():
for sub_module in submodules:
submod_name = "{0}.{1}".format(module,sub_module)
module_names.append(submod_name)
modules = map(__import__, module_names)
modules = map(import_module, module_names)
return modules
def namespace(f):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment