etwist/twconfig.py
branchtls-sprint
changeset 1802 d628defebc17
parent 136 ff51a18c66a3
child 1977 606923dff11b
equal deleted inserted replaced
1801:672acc730ce5 1802:d628defebc17
     1 """twisted server configurations:
     1 """twisted server configurations:
     2 
     2 
     3 * the "twisted" configuration to get a web application running in a standalone
     3 * the "twisted" configuration to get a web application running in a standalone
     4   twisted web server which talk to a repository server using Pyro
     4   twisted web server which talk to a repository server using Pyro
     5   
     5 
     6 * the "all-in-one" configuration to get a web application running in a twisted
     6 * the "all-in-one" configuration to get a web application running in a twisted
     7   web server integrating a repository server in the same process (only available
     7   web server integrating a repository server in the same process (only available
     8   if the repository part of the software is installed
     8   if the repository part of the software is installed
     9 
     9 
    10 :organization: Logilab
    10 :organization: Logilab
    11 :copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
    11 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
    12 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
    12 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
    13 """
    13 """
    14 __docformat__ = "restructuredtext en"
    14 __docformat__ = "restructuredtext en"
    15 
    15 
    16 from os.path import join
    16 from os.path import join
    61           'group': 'main', 'inputlevel': 2,
    61           'group': 'main', 'inputlevel': 2,
    62           }),
    62           }),
    63         ('pyro-server',
    63         ('pyro-server',
    64          {'type' : 'yn',
    64          {'type' : 'yn',
    65           # pyro is only a recommends by default, so don't activate it here
    65           # pyro is only a recommends by default, so don't activate it here
    66           'default': False, 
    66           'default': False,
    67           'help': 'run a pyro server',
    67           'help': 'run a pyro server',
    68           'group': 'main', 'inputlevel': 1,
    68           'group': 'main', 'inputlevel': 1,
    69           }),
    69           }),
    70         ) + WebConfiguration.options)
    70         ) + WebConfiguration.options)
    71     
    71 
    72     def server_file(self):
    72     def server_file(self):
    73         return join(self.apphome, '%s-%s.py' % (self.appid, self.name))
    73         return join(self.apphome, '%s-%s.py' % (self.appid, self.name))
    74 
    74 
    75     def default_base_url(self):
    75     def default_base_url(self):
    76         from socket import gethostname
    76         from socket import gethostname
    89         cubicweb_vobject_path = TwistedConfiguration.cubicweb_vobject_path | ServerConfiguration.cubicweb_vobject_path
    89         cubicweb_vobject_path = TwistedConfiguration.cubicweb_vobject_path | ServerConfiguration.cubicweb_vobject_path
    90         cube_vobject_path = TwistedConfiguration.cube_vobject_path | ServerConfiguration.cube_vobject_path
    90         cube_vobject_path = TwistedConfiguration.cube_vobject_path | ServerConfiguration.cube_vobject_path
    91         def pyro_enabled(self):
    91         def pyro_enabled(self):
    92             """tell if pyro is activated for the in memory repository"""
    92             """tell if pyro is activated for the in memory repository"""
    93             return self['pyro-server']
    93             return self['pyro-server']
    94         
    94 
    95 except ImportError:
    95 except ImportError:
    96     pass
    96     pass