# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1238089889 -3600 # Node ID a7c0894051851db18e3c5f3e0e3a9f3608e26312 # Parent 52058e8a3af925b6166402b60e1a900db751a578 refactor to avoid having to define CW_INSTANCE_DATA when CW_REGISTRY is set diff -r 52058e8a3af9 -r a7c089405185 cwconfig.py --- a/cwconfig.py Thu Mar 26 18:21:22 2009 +0100 +++ b/cwconfig.py Thu Mar 26 18:51:29 2009 +0100 @@ -501,17 +501,16 @@ class CubicWebConfiguration(CubicWebNoAppConfiguration): """base class for cubicweb server and web configurations""" + INSTANCE_DATA_DIR = None if CubicWebNoAppConfiguration.mode == 'test': root = os.environ['APYCOT_ROOT'] REGISTRY_DIR = '%s/etc/cubicweb.d/' % root - INSTANCE_DATA_DIR = REGISTRY_DIR RUNTIME_DIR = '/tmp/' MIGRATION_DIR = '%s/local/share/cubicweb/migration/' % root if not exists(REGISTRY_DIR): os.makedirs(REGISTRY_DIR) elif CubicWebNoAppConfiguration.mode == 'dev': REGISTRY_DIR = expanduser('~/etc/cubicweb.d/') - INSTANCE_DATA_DIR = REGISTRY_DIR RUNTIME_DIR = '/tmp/' MIGRATION_DIR = join(CW_SOFTWARE_ROOT, 'misc', 'migration') else: #mode = 'installed' @@ -574,7 +573,8 @@ @classmethod def instance_data_dir(cls): """return the instance data directory""" - return env_path('CW_INSTANCE_DATA', cls.INSTANCE_DATA_DIR, + return env_path('CW_INSTANCE_DATA', + cls.INSTANCE_DATA_DIR or cls.REGISTRY_DIR, 'additional data') @classmethod