fixed problem with GAE and custom-import, thanks howesc
This commit is contained in:
@@ -1 +1 @@
|
||||
Version 1.99.3 (2011-11-25 21:47:39) dev
|
||||
Version 1.99.3 (2011-11-25 21:51:08) dev
|
||||
|
||||
@@ -83,6 +83,10 @@ def wsgiapp(env, res):
|
||||
if global_settings.web2py_runtime == 'gae:development':
|
||||
gluon.admin.create_missing_folders()
|
||||
|
||||
from gluon.custom_import import custom_import_install
|
||||
web2py_path = global_settings.applications_parent # backward compatibility
|
||||
custom_import_install(web2py_path)
|
||||
|
||||
return gluon.main.wsgibase(env, res)
|
||||
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ import threading
|
||||
def custom_import_install(web2py_path):
|
||||
global _web2py_importer
|
||||
global _web2py_path
|
||||
if _web2py_path == web2py_path:
|
||||
return # Already installed
|
||||
if isinstance(__builtin__.__import__, _Web2pyImporter):
|
||||
return #aready installed
|
||||
_web2py_path = web2py_path
|
||||
_web2py_importer = _Web2pyImporter(web2py_path)
|
||||
__builtin__.__import__ = _web2py_importer
|
||||
|
||||
Reference in New Issue
Block a user