# HG changeset patch # User Sylvain Thénault # Date 1268392167 -3600 # Node ID b3e2de8f53cde9f43b61d57f48ee8a73e419df81 # Parent fc8b4d861f34257607e28251ef39673ca62b0348 fix apycot detection diff -r fc8b4d861f34 -r b3e2de8f53cd cwconfig.py --- a/cwconfig.py Fri Mar 12 11:50:27 2010 +0100 +++ b/cwconfig.py Fri Mar 12 12:09:27 2010 +0100 @@ -217,7 +217,9 @@ if os.environ.get('APYCOT_ROOT'): mode = 'test' - if CWDEV: + # allow to test cubes within apycot using cubicweb not installed by + # apycot + if __file__.startswith(os.environ['APYCOT_ROOT']): CUBES_DIR = '%(APYCOT_ROOT)s/local/share/cubicweb/cubes/' % os.environ # create __init__ file file(join(CUBES_DIR, '__init__.py'), 'w').close() @@ -638,16 +640,18 @@ """base class for cubicweb server and web configurations""" INSTANCES_DATA_DIR = None - if CubicWebNoAppConfiguration.mode == 'test': + if os.environ.get('APYCOT_ROOT'): root = os.environ['APYCOT_ROOT'] REGISTRY_DIR = '%s/etc/cubicweb.d/' % root + if not exists(REGISTRY_DIR): + os.makedirs(REGISTRY_DIR) RUNTIME_DIR = tempfile.gettempdir() - if CWDEV: + # allow to test cubes within apycot using cubicweb not installed by + # apycot + if __file__.startswith(os.environ['APYCOT_ROOT']): MIGRATION_DIR = '%s/local/share/cubicweb/migration/' % root else: MIGRATION_DIR = '/usr/share/cubicweb/migration/' - if not exists(REGISTRY_DIR): - os.makedirs(REGISTRY_DIR) else: if CubicWebNoAppConfiguration.mode == 'user': REGISTRY_DIR = expanduser('~/etc/cubicweb.d/')