server/serverconfig.py
changeset 2730 bb6fcb8c5d71
parent 2665 0c6281487f90
child 2809 04fa75d43af4
child 2959 daabb9bc5233
equal deleted inserted replaced
2729:d3dbd135f319 2730:bb6fcb8c5d71
    75 class ServerConfiguration(CubicWebConfiguration):
    75 class ServerConfiguration(CubicWebConfiguration):
    76     """standalone RQL server"""
    76     """standalone RQL server"""
    77     name = 'repository'
    77     name = 'repository'
    78     if os.environ.get('APYCOT_ROOT'):
    78     if os.environ.get('APYCOT_ROOT'):
    79         root = os.environ['APYCOT_ROOT']
    79         root = os.environ['APYCOT_ROOT']
    80         SCHEMAS_LIB_DIR = '%s/local/share/cubicweb/schemas/' % root
       
    81     elif CubicWebConfiguration.mode == 'dev':
    80     elif CubicWebConfiguration.mode == 'dev':
    82         SCHEMAS_LIB_DIR = join(CW_SOFTWARE_ROOT, 'schemas')
       
    83         BACKUP_DIR = CubicWebConfiguration.RUNTIME_DIR
    81         BACKUP_DIR = CubicWebConfiguration.RUNTIME_DIR
    84     else:
    82     else:
    85         SCHEMAS_LIB_DIR = '/usr/share/cubicweb/schemas/'
       
    86         BACKUP_DIR = '/var/lib/cubicweb/backup/'
    83         BACKUP_DIR = '/var/lib/cubicweb/backup/'
    87 
    84 
    88     cubicweb_appobject_path = CubicWebConfiguration.cubicweb_appobject_path | set(['sobjects'])
    85     cubicweb_appobject_path = CubicWebConfiguration.cubicweb_appobject_path | set(['sobjects'])
    89     cube_appobject_path = CubicWebConfiguration.cube_appobject_path | set(['sobjects', 'hooks'])
    86     cube_appobject_path = CubicWebConfiguration.cube_appobject_path | set(['sobjects', 'hooks'])
    90 
    87 
   205     _enabled_sources = None
   202     _enabled_sources = None
   206     @wproperty
   203     @wproperty
   207     def enabled_sources(self, sourceuris=None):
   204     def enabled_sources(self, sourceuris=None):
   208         self._enabled_sources = sourceuris
   205         self._enabled_sources = sourceuris
   209         clear_cache(self, 'sources')
   206         clear_cache(self, 'sources')
   210 
       
   211     @classmethod
       
   212     def schemas_lib_dir(cls):
       
   213         """instance schema directory"""
       
   214         return env_path('CW_SCHEMA_LIB', cls.SCHEMAS_LIB_DIR, 'schemas')
       
   215 
   207 
   216     def bootstrap_cubes(self):
   208     def bootstrap_cubes(self):
   217         from logilab.common.textutils import splitstrip
   209         from logilab.common.textutils import splitstrip
   218         for line in file(join(self.apphome, 'bootstrap_cubes')):
   210         for line in file(join(self.apphome, 'bootstrap_cubes')):
   219             line = line.strip()
   211             line = line.strip()