# HG changeset patch # User Goffi # Date 1402583230 -7200 # Node ID 6700386291f1229848d348b2241b8496498a7093 # Parent d1565906f228a2583ca11c88a23cfe5cbe535d05 server side: fix unicodes issues in options diff -r d1565906f228 -r 6700386291f1 src/server/server.py --- a/src/server/server.py Tue Jun 10 16:02:45 2014 +0200 +++ b/src/server/server.py Thu Jun 12 16:27:10 2014 +0200 @@ -1006,15 +1006,15 @@ class Libervia(service.Service): DATA_DIR_DEFAULT = '' - OPT_PARAMETERS_BOTH = [['connection_type', 't', 'https', _(u"'http', 'https' or 'both' (to launch both servers)."), coerceConnectionType], - ['port', 'p', 8080, _(u'The port number to listen HTTP on.'), int], - ['port_https', 's', 8443, _(u'The port number to listen HTTPS on.'), int], - ['port_https_ext', 'e', 0, _(u'The external port number used for HTTPS (0 means port_https value).'), int], - ['ssl_certificate', 'c', 'libervia.pem', _(u'PEM certificate with both private and public parts.'), str], - ['redirect_to_https', 'r', 1, _(u'Automatically redirect from HTTP to HTTPS.'), int], - ['security_warning', 'w', 1, _(u'Warn user that he is about to connect on HTTP.'), int], - ['passphrase', 'k', '', _(u"Passphrase for the SàT profile named '%s'") % C.SERVICE_PROFILE, str], - ['data_dir', 'd', DATA_DIR_DEFAULT, _(u'Data directory for Libervia'), coerceDataDir], + OPT_PARAMETERS_BOTH = [['connection_type', 't', 'https', _(u"'http', 'https' or 'both' (to launch both servers).").encode('utf-8'), coerceConnectionType], + ['port', 'p', 8080, _(u'The port number to listen HTTP on.').encode('utf-8'), int], + ['port_https', 's', 8443, _(u'The port number to listen HTTPS on.').encode('utf-8'), int], + ['port_https_ext', 'e', 0, _(u'The external port number used for HTTPS (0 means port_https value).').encode('utf-8'), int], + ['ssl_certificate', 'c', 'libervia.pem', _(u'PEM certificate with both private and public parts.').encode('utf-8'), str], + ['redirect_to_https', 'r', 1, _(u'Automatically redirect from HTTP to HTTPS.').encode('utf-8'), int], + ['security_warning', 'w', 1, _(u'Warn user that he is about to connect on HTTP.').encode('utf-8'), int], + ['passphrase', 'k', '', (u"Passphrase for the SàT profile named '%s'" % C.SERVICE_PROFILE).encode('utf-8'), str], + ['data_dir', 'd', DATA_DIR_DEFAULT, _(u'Data directory for Libervia').encode('utf-8'), coerceDataDir], ] # options which are in sat.conf and on command line, see https://twistedmatrix.com/documents/current/api/twisted.python.usage.Options.html OPT_PARAMETERS_CFG = [['empty_password_allowed_warning_dangerous_list', None, '', None]] # Options which are in sat.conf only diff -r d1565906f228 -r 6700386291f1 src/twisted/plugins/libervia_server.py --- a/src/twisted/plugins/libervia_server.py Tue Jun 10 16:02:45 2014 +0200 +++ b/src/twisted/plugins/libervia_server.py Thu Jun 12 16:27:10 2014 +0200 @@ -91,7 +91,7 @@ implements(IServiceMaker, IPlugin) tapname = C.ASCII_APP_NAME - description = _(u'The web frontend of Salut à Toi') + description = _(u'The web frontend of Salut à Toi').encode('utf-8') options = Options def makeService(self, options):