etwist/twctl.py
changeset 9372 e87a808a4c32
parent 7619 0d0344fd5231
child 10237 1e030b1a5622
equal deleted inserted replaced
9371:1348202527a6 9372:e87a808a4c32
    20 from os.path import join
    20 from os.path import join
    21 
    21 
    22 from logilab.common.shellutils import rm
    22 from logilab.common.shellutils import rm
    23 
    23 
    24 from cubicweb.toolsutils import CommandHandler
    24 from cubicweb.toolsutils import CommandHandler
    25 from cubicweb.web.webctl import WebCreateHandler
    25 from cubicweb.web.webctl import WebCreateHandler, WebUpgradeHandler
    26 
    26 
    27 # trigger configuration registration
    27 # trigger configuration registration
    28 import cubicweb.etwist.twconfig # pylint: disable=W0611
    28 import cubicweb.etwist.twconfig # pylint: disable=W0611
    29 
    29 
    30 class TWCreateHandler(WebCreateHandler):
    30 class TWCreateHandler(WebCreateHandler):
    45     cmdname = 'stop'
    45     cmdname = 'stop'
    46     cfgname = 'twisted'
    46     cfgname = 'twisted'
    47 
    47 
    48     def poststop(self):
    48     def poststop(self):
    49         pass
    49         pass
       
    50 
       
    51 class TWUpgradeHandler(WebUpgradeHandler):
       
    52     cfgname = 'twisted'
    50 
    53 
    51 
    54 
    52 try:
    55 try:
    53     from cubicweb.server import serverctl
    56     from cubicweb.server import serverctl
    54     class AllInOneCreateHandler(serverctl.RepositoryCreateHandler,
    57     class AllInOneCreateHandler(serverctl.RepositoryCreateHandler,
    71     class AllInOneStopHandler(serverctl.RepositoryStopHandler):
    74     class AllInOneStopHandler(serverctl.RepositoryStopHandler):
    72         cmdname = 'stop'
    75         cmdname = 'stop'
    73         cfgname = 'all-in-one'
    76         cfgname = 'all-in-one'
    74         subcommand = 'cubicweb-twisted'
    77         subcommand = 'cubicweb-twisted'
    75 
    78 
       
    79     class AllInOneUpgradeHandler(TWUpgradeHandler):
       
    80         cfgname = 'all-in-one'
       
    81 
    76 except ImportError:
    82 except ImportError:
    77     pass
    83     pass