499 |
499 |
500 |
500 |
501 class CubicWebConfiguration(CubicWebNoAppConfiguration): |
501 class CubicWebConfiguration(CubicWebNoAppConfiguration): |
502 """base class for cubicweb server and web configurations""" |
502 """base class for cubicweb server and web configurations""" |
503 |
503 |
|
504 INSTANCE_DATA_DIR = None |
504 if CubicWebNoAppConfiguration.mode == 'test': |
505 if CubicWebNoAppConfiguration.mode == 'test': |
505 root = os.environ['APYCOT_ROOT'] |
506 root = os.environ['APYCOT_ROOT'] |
506 REGISTRY_DIR = '%s/etc/cubicweb.d/' % root |
507 REGISTRY_DIR = '%s/etc/cubicweb.d/' % root |
507 INSTANCE_DATA_DIR = REGISTRY_DIR |
|
508 RUNTIME_DIR = '/tmp/' |
508 RUNTIME_DIR = '/tmp/' |
509 MIGRATION_DIR = '%s/local/share/cubicweb/migration/' % root |
509 MIGRATION_DIR = '%s/local/share/cubicweb/migration/' % root |
510 if not exists(REGISTRY_DIR): |
510 if not exists(REGISTRY_DIR): |
511 os.makedirs(REGISTRY_DIR) |
511 os.makedirs(REGISTRY_DIR) |
512 elif CubicWebNoAppConfiguration.mode == 'dev': |
512 elif CubicWebNoAppConfiguration.mode == 'dev': |
513 REGISTRY_DIR = expanduser('~/etc/cubicweb.d/') |
513 REGISTRY_DIR = expanduser('~/etc/cubicweb.d/') |
514 INSTANCE_DATA_DIR = REGISTRY_DIR |
|
515 RUNTIME_DIR = '/tmp/' |
514 RUNTIME_DIR = '/tmp/' |
516 MIGRATION_DIR = join(CW_SOFTWARE_ROOT, 'misc', 'migration') |
515 MIGRATION_DIR = join(CW_SOFTWARE_ROOT, 'misc', 'migration') |
517 else: #mode = 'installed' |
516 else: #mode = 'installed' |
518 REGISTRY_DIR = '/etc/cubicweb.d/' |
517 REGISTRY_DIR = '/etc/cubicweb.d/' |
519 INSTANCE_DATA_DIR = '/var/lib/cubicweb/instances/' |
518 INSTANCE_DATA_DIR = '/var/lib/cubicweb/instances/' |
572 return env_path('CW_REGISTRY', cls.REGISTRY_DIR, 'registry') |
571 return env_path('CW_REGISTRY', cls.REGISTRY_DIR, 'registry') |
573 |
572 |
574 @classmethod |
573 @classmethod |
575 def instance_data_dir(cls): |
574 def instance_data_dir(cls): |
576 """return the instance data directory""" |
575 """return the instance data directory""" |
577 return env_path('CW_INSTANCE_DATA', cls.INSTANCE_DATA_DIR, |
576 return env_path('CW_INSTANCE_DATA', |
|
577 cls.INSTANCE_DATA_DIR or cls.REGISTRY_DIR, |
578 'additional data') |
578 'additional data') |
579 |
579 |
580 @classmethod |
580 @classmethod |
581 def migration_scripts_dir(cls): |
581 def migration_scripts_dir(cls): |
582 """cubicweb migration scripts directory""" |
582 """cubicweb migration scripts directory""" |