cwctl.py
changeset 5025 2826f5406201
parent 5021 58e89f3dfbae
child 5026 1f8238eaec9b
equal deleted inserted replaced
5024:9e718abe3fde 5025:2826f5406201
    11 
    11 
    12 # *ctl module should limit the number of import to be imported as quickly as
    12 # *ctl module should limit the number of import to be imported as quickly as
    13 # possible (for cubicweb-ctl reactivity, necessary for instance for usable bash
    13 # possible (for cubicweb-ctl reactivity, necessary for instance for usable bash
    14 # completion). So import locally in command helpers.
    14 # completion). So import locally in command helpers.
    15 import sys
    15 import sys
       
    16 from warnings import warn
    16 from os import remove, listdir, system, pathsep
    17 from os import remove, listdir, system, pathsep
    17 try:
    18 try:
    18     from os import kill, getpgid
    19     from os import kill, getpgid
    19 except ImportError:
    20 except ImportError:
    20     def kill(*args):
    21     def kill(*args):
   293                 except ConfigurationError:
   294                 except ConfigurationError:
   294                     tinfo = None
   295                     tinfo = None
   295                     tversion = '[missing cube information]'
   296                     tversion = '[missing cube information]'
   296                 print '* %s %s' % (cube.ljust(namesize), tversion)
   297                 print '* %s %s' % (cube.ljust(namesize), tversion)
   297                 if self.config.verbose:
   298                 if self.config.verbose:
   298                     shortdesc = tinfo and (getattr(tinfo, 'short_desc', '')
   299                     if tinfo:
   299                                            or tinfo.__doc__)
   300                         descr = getattr(tinfo, 'description', '')
   300                     if shortdesc:
   301                         if not descr:
   301                         print '    '+ '    \n'.join(shortdesc.splitlines())
   302                             descr = getattr(tinfo, 'short_desc', '')
       
   303                             if descr:
       
   304                                 warn('[3.8] short_desc is deprecated, update %s'
       
   305                                      ' pkginfo' % cube, DeprecationWarning)
       
   306                             else:
       
   307                                 descr = tinfo.__doc__
       
   308                         if descr:
       
   309                             print '    '+ '    \n'.join(descr.splitlines())
   302                     modes = detect_available_modes(cwcfg.cube_dir(cube))
   310                     modes = detect_available_modes(cwcfg.cube_dir(cube))
   303                     print '    available modes: %s' % ', '.join(modes)
   311                     print '    available modes: %s' % ', '.join(modes)
   304         print
   312         print
   305         try:
   313         try:
   306             regdir = cwcfg.instances_dir()
   314             regdir = cwcfg.instances_dir()