cwctl.py
branchtls-sprint
changeset 1263 01152fffd593
parent 1132 96752791c2b6
parent 1219 054bb575c013
child 1342 4273e44852cb
equal deleted inserted replaced
1246:76b3cd5d4f31 1263:01152fffd593
   185         else:
   185         else:
   186             print 'Available cubes (%s):' % cubesdir
   186             print 'Available cubes (%s):' % cubesdir
   187             for cube in cwcfg.available_cubes():
   187             for cube in cwcfg.available_cubes():
   188                 if cube in ('CVS', '.svn', 'shared', '.hg'):
   188                 if cube in ('CVS', '.svn', 'shared', '.hg'):
   189                     continue
   189                     continue
   190                 templdir = join(cubesdir, cube)
       
   191                 try:
   190                 try:
   192                     tinfo = cwcfg.cube_pkginfo(cube)
   191                     tinfo = cwcfg.cube_pkginfo(cube)
   193                     tversion = tinfo.version
   192                     tversion = tinfo.version
   194                 except ConfigurationError:
   193                 except ConfigurationError:
   195                     tinfo = None
   194                     tinfo = None
   198                 if self.config.verbose:
   197                 if self.config.verbose:
   199                     shortdesc = tinfo and (getattr(tinfo, 'short_desc', '')
   198                     shortdesc = tinfo and (getattr(tinfo, 'short_desc', '')
   200                                            or tinfo.__doc__)
   199                                            or tinfo.__doc__)
   201                     if shortdesc:
   200                     if shortdesc:
   202                         print '    '+ '    \n'.join(shortdesc.splitlines())
   201                         print '    '+ '    \n'.join(shortdesc.splitlines())
   203                     modes = detect_available_modes(templdir)
   202                     modes = detect_available_modes(CubicWebConfiguration.cube_dir(cube))
   204                     print '    available modes: %s' % ', '.join(modes)
   203                     print '    available modes: %s' % ', '.join(modes)
   205         print
   204         print
   206         try:
   205         try:
   207             regdir = cwcfg.registry_dir()
   206             regdir = cwcfg.registry_dir()
   208         except ConfigurationError, ex:
   207         except ConfigurationError, ex:
   620         if not (cwcfg.mode == 'dev' or self.config.nostartstop):
   619         if not (cwcfg.mode == 'dev' or self.config.nostartstop):
   621             self.stop_application(appid)
   620             self.stop_application(appid)
   622         config = cwcfg.config_for(appid)
   621         config = cwcfg.config_for(appid)
   623         config.creating = True # notice we're not starting the server
   622         config.creating = True # notice we're not starting the server
   624         config.verbosity = self.config.verbosity
   623         config.verbosity = self.config.verbosity
   625         config.set_sources_mode(self.config.ext_sources or ('migration',))
   624         try:
       
   625             config.set_sources_mode(self.config.ext_sources or ('migration',))
       
   626         except AttributeError:
       
   627             # not a server config
       
   628             pass
   626         # get application and installed versions for the server and the componants
   629         # get application and installed versions for the server and the componants
   627         print 'getting versions configuration from the repository...'
   630         print 'getting versions configuration from the repository...'
   628         mih = config.migration_handler()
   631         mih = config.migration_handler()
   629         repo = mih.repo_connect()
   632         repo = mih.repo_connect()
   630         vcconf = repo.get_versions()
   633         vcconf = repo.get_versions()