etwist/twctl.py
branchtls-sprint
changeset 1802 d628defebc17
parent 0 b97547f5f1fa
child 1977 606923dff11b
equal deleted inserted replaced
1801:672acc730ce5 1802:d628defebc17
     1 """cubicweb-clt handlers for twisted
     1 """cubicweb-clt handlers for twisted
       
     2 
       
     3 :organization: Logilab
       
     4 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
       
     5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
     2 """
     6 """
     3 
     7 
     4 import sys
     8 import sys
     5 
     9 
     6 from cubicweb.toolsutils import CommandHandler
    10 from cubicweb.toolsutils import CommandHandler
    50 
    54 
    51 
    55 
    52 class TWStopHandler(CommandHandler):
    56 class TWStopHandler(CommandHandler):
    53     cmdname = 'stop'
    57     cmdname = 'stop'
    54     cfgname = 'twisted'
    58     cfgname = 'twisted'
    55     
    59 
    56     
    60 
    57 try:
    61 try:
    58     from cubicweb.server import serverctl
    62     from cubicweb.server import serverctl
    59 
    63 
    60     class AllInOneCreateHandler(serverctl.RepositoryCreateHandler, TWCreateHandler):
    64     class AllInOneCreateHandler(serverctl.RepositoryCreateHandler, TWCreateHandler):
    61         """configuration to get a web application running in a twisted web
    65         """configuration to get a web application running in a twisted web
    65 
    69 
    66         def bootstrap(self, cubes, inputlevel=0):
    70         def bootstrap(self, cubes, inputlevel=0):
    67             """bootstrap this configuration"""
    71             """bootstrap this configuration"""
    68             serverctl.RepositoryCreateHandler.bootstrap(self, cubes, inputlevel)
    72             serverctl.RepositoryCreateHandler.bootstrap(self, cubes, inputlevel)
    69             TWCreateHandler.bootstrap(self, cubes, inputlevel)
    73             TWCreateHandler.bootstrap(self, cubes, inputlevel)
    70             
    74 
    71     class AllInOneStartHandler(TWStartHandler):
    75     class AllInOneStartHandler(TWStartHandler):
    72         cmdname = 'start'
    76         cmdname = 'start'
    73         cfgname = 'all-in-one'
    77         cfgname = 'all-in-one'
    74         subcommand = 'cubicweb-twisted'
    78         subcommand = 'cubicweb-twisted'
    75 
    79 
    78         cfgname = 'all-in-one'
    82         cfgname = 'all-in-one'
    79         subcommand = 'cubicweb-twisted'
    83         subcommand = 'cubicweb-twisted'
    80 
    84 
    81 except ImportError:
    85 except ImportError:
    82     pass
    86     pass
    83