585 cubes.__path__ = cls.cubes_search_path() |
585 cubes.__path__ = cls.cubes_search_path() |
586 except ImportError: |
586 except ImportError: |
587 return # cubes dir doesn't exists |
587 return # cubes dir doesn't exists |
588 |
588 |
589 @classmethod |
589 @classmethod |
|
590 def load_available_configs(cls): |
|
591 from logilab.common.modutils import load_module_from_file |
|
592 for conffile in ('web/webconfig.py', 'etwist/twconfig.py', |
|
593 'server/serverconfig.py',): |
|
594 if exists(join(CW_SOFTWARE_ROOT, conffile)): |
|
595 load_module_from_file(join(CW_SOFTWARE_ROOT, conffile)) |
|
596 |
|
597 @classmethod |
590 def load_cwctl_plugins(cls): |
598 def load_cwctl_plugins(cls): |
591 from logilab.common.modutils import load_module_from_file |
599 from logilab.common.modutils import load_module_from_file |
592 cls.cls_adjust_sys_path() |
600 cls.cls_adjust_sys_path() |
593 for ctlfile in ('web/webctl.py', 'etwist/twctl.py', |
601 for ctlfile in ('web/webctl.py', 'etwist/twctl.py', |
594 'server/serverctl.py', |
602 'server/serverctl.py', |
595 'devtools/devctl.py', 'goa/goactl.py'): |
603 'devtools/devctl.py', 'goa/goactl.py'): |
596 if exists(join(CW_SOFTWARE_ROOT, ctlfile)): |
604 if exists(join(CW_SOFTWARE_ROOT, ctlfile)): |
597 try: |
605 try: |
598 load_module_from_file(join(CW_SOFTWARE_ROOT, ctlfile)) |
606 load_module_from_file(join(CW_SOFTWARE_ROOT, ctlfile)) |
599 except ImportError, err: |
607 except ImportError, err: |
600 cls.info('could not import the command provider %s (cause : %s)' % |
608 cls.error('could not import the command provider %s: %s', |
601 (ctlfile, err)) |
609 ctlfile, err) |
602 cls.info('loaded cubicweb-ctl plugin %s', ctlfile) |
610 cls.info('loaded cubicweb-ctl plugin %s', ctlfile) |
603 for cube in cls.available_cubes(): |
611 for cube in cls.available_cubes(): |
604 oldpluginfile = join(cls.cube_dir(cube), 'ecplugin.py') |
612 oldpluginfile = join(cls.cube_dir(cube), 'ecplugin.py') |
605 pluginfile = join(cls.cube_dir(cube), 'ccplugin.py') |
613 pluginfile = join(cls.cube_dir(cube), 'ccplugin.py') |
606 initfile = join(cls.cube_dir(cube), '__init__.py') |
614 initfile = join(cls.cube_dir(cube), '__init__.py') |
893 |
901 |
894 @classmethod |
902 @classmethod |
895 def config_for(cls, appid, config=None, debugmode=False): |
903 def config_for(cls, appid, config=None, debugmode=False): |
896 """return a configuration instance for the given instance identifier |
904 """return a configuration instance for the given instance identifier |
897 """ |
905 """ |
|
906 cls.load_available_configs() |
898 config = config or guess_configuration(cls.instance_home(appid)) |
907 config = config or guess_configuration(cls.instance_home(appid)) |
899 configcls = configuration_cls(config) |
908 configcls = configuration_cls(config) |
900 return configcls(appid, debugmode) |
909 return configcls(appid, debugmode) |
901 |
910 |
902 @classmethod |
911 @classmethod |