fixed problem with custom import and upgraded jquery.js

This commit is contained in:
mdipierro
2015-04-02 16:30:15 -05:00
parent a2b17967cf
commit b02e8a6d5f
5 changed files with 17 additions and 14 deletions
+5 -2
View File
@@ -41,12 +41,15 @@ class CustomImportException(ImportError):
def custom_importer(name, globals=None, locals=None, fromlist=None, level=-1):
"""
web2py's custom importer. It behaves like the standard Python importer but
web2py's custom importer. It behaves like the standard Python importer but
it tries to transform import statements as something like
"import applications.app_name.modules.x".
If the import fails, it falls back on naive_importer
"""
if isinstance(name, unicode):
name = name.encode('utf8')
globals = globals or {}
locals = locals or {}
fromlist = fromlist or []
@@ -77,7 +80,7 @@ def custom_importer(name, globals=None, locals=None, fromlist=None, level=-1):
if not fromlist:
# import like "import x" or "import x.y"
result = None
for itemname in name.split("."):
for itemname in name.split("."):
new_mod = base_importer(
modules_prefix, globals, locals, [itemname], level)
try: