comparison src/server/server.py @ 474:6700386291f1

server side: fix unicodes issues in options
author Goffi <goffi@goffi.org>
date Thu, 12 Jun 2014 16:27:10 +0200
parents d1565906f228
children 647b293fae06
comparison
equal deleted inserted replaced
473:d1565906f228 474:6700386291f1
1004 1004
1005 1005
1006 class Libervia(service.Service): 1006 class Libervia(service.Service):
1007 1007
1008 DATA_DIR_DEFAULT = '' 1008 DATA_DIR_DEFAULT = ''
1009 OPT_PARAMETERS_BOTH = [['connection_type', 't', 'https', _(u"'http', 'https' or 'both' (to launch both servers)."), coerceConnectionType], 1009 OPT_PARAMETERS_BOTH = [['connection_type', 't', 'https', _(u"'http', 'https' or 'both' (to launch both servers).").encode('utf-8'), coerceConnectionType],
1010 ['port', 'p', 8080, _(u'The port number to listen HTTP on.'), int], 1010 ['port', 'p', 8080, _(u'The port number to listen HTTP on.').encode('utf-8'), int],
1011 ['port_https', 's', 8443, _(u'The port number to listen HTTPS on.'), int], 1011 ['port_https', 's', 8443, _(u'The port number to listen HTTPS on.').encode('utf-8'), int],
1012 ['port_https_ext', 'e', 0, _(u'The external port number used for HTTPS (0 means port_https value).'), int], 1012 ['port_https_ext', 'e', 0, _(u'The external port number used for HTTPS (0 means port_https value).').encode('utf-8'), int],
1013 ['ssl_certificate', 'c', 'libervia.pem', _(u'PEM certificate with both private and public parts.'), str], 1013 ['ssl_certificate', 'c', 'libervia.pem', _(u'PEM certificate with both private and public parts.').encode('utf-8'), str],
1014 ['redirect_to_https', 'r', 1, _(u'Automatically redirect from HTTP to HTTPS.'), int], 1014 ['redirect_to_https', 'r', 1, _(u'Automatically redirect from HTTP to HTTPS.').encode('utf-8'), int],
1015 ['security_warning', 'w', 1, _(u'Warn user that he is about to connect on HTTP.'), int], 1015 ['security_warning', 'w', 1, _(u'Warn user that he is about to connect on HTTP.').encode('utf-8'), int],
1016 ['passphrase', 'k', '', _(u"Passphrase for the SàT profile named '%s'") % C.SERVICE_PROFILE, str], 1016 ['passphrase', 'k', '', (u"Passphrase for the SàT profile named '%s'" % C.SERVICE_PROFILE).encode('utf-8'), str],
1017 ['data_dir', 'd', DATA_DIR_DEFAULT, _(u'Data directory for Libervia'), coerceDataDir], 1017 ['data_dir', 'd', DATA_DIR_DEFAULT, _(u'Data directory for Libervia').encode('utf-8'), coerceDataDir],
1018 ] # options which are in sat.conf and on command line, see https://twistedmatrix.com/documents/current/api/twisted.python.usage.Options.html 1018 ] # options which are in sat.conf and on command line, see https://twistedmatrix.com/documents/current/api/twisted.python.usage.Options.html
1019 OPT_PARAMETERS_CFG = [['empty_password_allowed_warning_dangerous_list', None, '', None]] # Options which are in sat.conf only 1019 OPT_PARAMETERS_CFG = [['empty_password_allowed_warning_dangerous_list', None, '', None]] # Options which are in sat.conf only
1020 1020
1021 def __init__(self, *args, **kwargs): 1021 def __init__(self, *args, **kwargs):
1022 self.initialised = defer.Deferred() 1022 self.initialised = defer.Deferred()