cwconfig.py
branchstable
changeset 3915 2d23304289a6
parent 3641 cf30e4498674
child 4001 bc31ede2085d
equal deleted inserted replaced
3914:36be7a5e53ad 3915:2d23304289a6
   214     # debug mode
   214     # debug mode
   215     debugmode = False
   215     debugmode = False
   216 
   216 
   217     if os.environ.get('APYCOT_ROOT'):
   217     if os.environ.get('APYCOT_ROOT'):
   218         mode = 'test'
   218         mode = 'test'
   219         CUBES_DIR = '%(APYCOT_ROOT)s/local/share/cubicweb/cubes/' % os.environ
   219         if CWDEV:
   220         # create __init__ file
   220             CUBES_DIR = '%(APYCOT_ROOT)s/local/share/cubicweb/cubes/' % os.environ
   221         file(join(CUBES_DIR, '__init__.py'), 'w').close()
   221             # create __init__ file
       
   222             file(join(CUBES_DIR, '__init__.py'), 'w').close()
       
   223         else:
       
   224             CUBES_DIR = '/usr/share/cubicweb/cubes/'
   222     elif (CWDEV and _forced_mode != 'system'):
   225     elif (CWDEV and _forced_mode != 'system'):
   223         mode = 'user'
   226         mode = 'user'
   224         CUBES_DIR = abspath(normpath(join(CW_SOFTWARE_ROOT, '../cubes')))
   227         CUBES_DIR = abspath(normpath(join(CW_SOFTWARE_ROOT, '../cubes')))
   225     else:
   228     else:
   226         if _forced_mode == 'user':
   229         if _forced_mode == 'user':
   610     INSTANCES_DATA_DIR = None
   613     INSTANCES_DATA_DIR = None
   611     if CubicWebNoAppConfiguration.mode == 'test':
   614     if CubicWebNoAppConfiguration.mode == 'test':
   612         root = os.environ['APYCOT_ROOT']
   615         root = os.environ['APYCOT_ROOT']
   613         REGISTRY_DIR = '%s/etc/cubicweb.d/' % root
   616         REGISTRY_DIR = '%s/etc/cubicweb.d/' % root
   614         RUNTIME_DIR = tempfile.gettempdir()
   617         RUNTIME_DIR = tempfile.gettempdir()
   615         MIGRATION_DIR = '%s/local/share/cubicweb/migration/' % root
   618         if CWDEV:
       
   619             MIGRATION_DIR = '%s/local/share/cubicweb/migration/' % root
       
   620         else:
       
   621             MIGRATION_DIR = '/usr/share/cubicweb/migration/'
   616         if not exists(REGISTRY_DIR):
   622         if not exists(REGISTRY_DIR):
   617             os.makedirs(REGISTRY_DIR)
   623             os.makedirs(REGISTRY_DIR)
   618     else:
   624     else:
   619         if CubicWebNoAppConfiguration.mode == 'user':
   625         if CubicWebNoAppConfiguration.mode == 'user':
   620             REGISTRY_DIR = expanduser('~/etc/cubicweb.d/')
   626             REGISTRY_DIR = expanduser('~/etc/cubicweb.d/')