settings.is_source

This commit is contained in:
mdipierro
2013-08-08 03:25:10 -05:00
parent 856b6d658e
commit 182192857f
4 changed files with 13 additions and 1 deletions

View File

@@ -1 +1 @@
Version 2.6.0-development+timestamp.2013.08.07.18.02.33
Version 2.6.0-development+timestamp.2013.08.08.03.23.58

View File

@@ -16,6 +16,11 @@ if MULTI_USER_MODE and not is_manager():
session.flash = 'Not Authorized'
redirect(URL('default', 'site'))
from gluon.settings import settings
if not settings.is_source:
session.flash = 'Requires running web2py from source'
redirect(URL(request.application, 'default', 'site'))
forever = 10 ** 8

View File

@@ -10,6 +10,10 @@ except ImportError:
session.flash = T('requires python-git, but not installed')
redirect(URL('default', 'site'))
from gluon.settings import settings
if not settings.is_source:
session.flash = 'Requires running web2py from source'
redirect(URL(request.application, 'default', 'site'))
def deploy():
apps = sorted(file for file in os.listdir(apath(r=request)))

View File

@@ -36,3 +36,6 @@ global_settings.is_jython = \
'java' in sys.platform.lower() or \
hasattr(sys, 'JYTHON_JAR') or \
str(sys.copyright).find('Jython') > 0
global_settings.is_source = os.path.exists(os.path.join(
global_settings.gluon_parent,'web2py.py'))