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 socket 
10  import platform 
11  from storage import Storage 
12   
13  global_settings = Storage() 
14  settings = global_settings  # legacy compatibility 
15   
16  if not hasattr(os, 'mkdir'): 
17      global_settings.db_sessions = True 
18   
19  if global_settings.db_sessions is not True: 
20      global_settings.db_sessions = set() 
21   
22  global_settings.gluon_parent = \ 
23      os.environ.get('web2py_path', os.getcwd()) 
24   
25  global_settings.applications_parent = global_settings.gluon_parent 
26   
27  global_settings.app_folders = set() 
28   
29  global_settings.debugging = False 
30   
31  global_settings.is_pypy = \ 
32      hasattr(platform, 'python_implementation') and \ 
33      platform.python_implementation() == 'PyPy' 
34   
35  global_settings.is_jython = \ 
36      'java' in sys.platform.lower() or \ 
37      hasattr(sys, 'JYTHON_JAR') or \ 
38      str(sys.copyright).find('Jython') > 0 
39