cwconfig.py
changeset 4620 c4adfc2466f5
parent 4606 3b7ce7036b19
child 4624 1b46d5ece0d5
equal deleted inserted replaced
4597:e872097f2287 4620:c4adfc2466f5
   326     @classmethod
   326     @classmethod
   327     def available_cubes(cls):
   327     def available_cubes(cls):
   328         cubes = set()
   328         cubes = set()
   329         for directory in cls.cubes_search_path():
   329         for directory in cls.cubes_search_path():
   330             if not os.path.exists(directory):
   330             if not os.path.exists(directory):
   331                 self.error('unexistant directory in cubes search path: %s'
   331                 cls.error('unexistant directory in cubes search path: %s'
   332                            % directory)
   332                            % directory)
   333                 continue
   333                 continue
   334             for cube in os.listdir(directory):
   334             for cube in os.listdir(directory):
   335                 if isdir(join(directory, cube)) and not cube == 'shared':
   335                 if isdir(join(directory, cube)) and not cube == 'shared':
   336                     cubes.add(cube)
   336                     cubes.add(cube)
   345                 directory = abspath(normpath(directory))
   345                 directory = abspath(normpath(directory))
   346                 if exists(directory) and not directory in path:
   346                 if exists(directory) and not directory in path:
   347                     path.append(directory)
   347                     path.append(directory)
   348         except KeyError:
   348         except KeyError:
   349             pass
   349             pass
   350         if not cls.CUBES_DIR in path:
   350         if not cls.CUBES_DIR in path and exists(cls.CUBES_DIR):
   351             path.append(cls.CUBES_DIR)
   351             path.append(cls.CUBES_DIR)
   352         return path
   352         return path
   353 
   353 
   354     @classproperty
   354     @classproperty
   355     def extrapath(cls):
   355     def extrapath(cls):
   472     @classmethod
   472     @classmethod
   473     def load_cwctl_plugins(cls):
   473     def load_cwctl_plugins(cls):
   474         from logilab.common.modutils import load_module_from_file
   474         from logilab.common.modutils import load_module_from_file
   475         cls.cls_adjust_sys_path()
   475         cls.cls_adjust_sys_path()
   476         for ctlfile in ('web/webctl.py',  'etwist/twctl.py',
   476         for ctlfile in ('web/webctl.py',  'etwist/twctl.py',
   477                         'server/serverctl.py', 
   477                         'server/serverctl.py',
   478                         'devtools/devctl.py', 'goa/goactl.py'):
   478                         'devtools/devctl.py', 'goa/goactl.py'):
   479             if exists(join(CW_SOFTWARE_ROOT, ctlfile)):
   479             if exists(join(CW_SOFTWARE_ROOT, ctlfile)):
   480                 try:
   480                 try:
   481                     load_module_from_file(join(CW_SOFTWARE_ROOT, ctlfile))
   481                     load_module_from_file(join(CW_SOFTWARE_ROOT, ctlfile))
   482                 except ImportError, err:
   482                 except ImportError, err: