Package gluon :: Module settings
[hide private]
[frames] | no frames]

Source Code for Module gluon.settings

 1  """ 
 2  This file is part of the web2py Web Framework 
 3  Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> 
 4  License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) 
 5  """ 
 6   
 7  import os 
 8  import sys 
 9  import platform 
10  from gluon.storage import Storage 
11   
12  global_settings = Storage() 
13  settings = global_settings  # legacy compatibility 
14   
15  if not hasattr(os, 'mkdir'): 
16      global_settings.db_sessions = True 
17   
18  if global_settings.db_sessions is not True: 
19      global_settings.db_sessions = set() 
20   
21  global_settings.gluon_parent = \ 
22      os.environ.get('web2py_path', os.getcwd()) 
23   
24  global_settings.applications_parent = global_settings.gluon_parent 
25   
26  global_settings.app_folders = set() 
27   
28  global_settings.debugging = False 
29   
30  global_settings.is_pypy = \ 
31      hasattr(platform, 'python_implementation') and \ 
32      platform.python_implementation() == 'PyPy' 
33   
34  global_settings.is_jython = \ 
35      'java' in sys.platform.lower() or \ 
36      hasattr(sys, 'JYTHON_JAR') or \ 
37      str(sys.copyright).find('Jython') > 0 
38   
39  global_settings.is_source = os.path.exists(os.path.join( 
40          global_settings.gluon_parent,'web2py.py')) 
41