Projects
Kolab:16
pykolab
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 34
View file
0003-Fix-unicode-in-roundcube-config-templates.patch
Changed
@@ -1,15 +1,15 @@ -From 42dd21a3743fb58856feeb42f815d2bee0ce36b5 Mon Sep 17 00:00:00 2001 +From 4db1d5e189b8b07f06092acbef623a3a0c2968ee Mon Sep 17 00:00:00 2001 From: "Jeroen van Meeuwen (Kolab Systems)" <vanmeeuwen@kolabsys.com> Date: Tue, 21 May 2019 17:36:34 +0200 Subject: [PATCH 3/3] Fix unicode in roundcube config templates --- - pykolab/setup/setup_roundcube.py | 248 +++++++++++++++++-------------- + pykolab/setup/setup_roundcube.py | 256 +++++++++++++++++-------------- pykolab/translate.py | 21 ++- - 2 files changed, 155 insertions(+), 114 deletions(-) + 2 files changed, 159 insertions(+), 118 deletions(-) diff --git a/pykolab/setup/setup_roundcube.py b/pykolab/setup/setup_roundcube.py -index 9b6d664..b7b38ed 100644 +index 9b6d664..b03a90f 100644 --- a/pykolab/setup/setup_roundcube.py +++ b/pykolab/setup/setup_roundcube.py @@ -17,7 +17,7 @@ @@ -56,11 +56,11 @@ - interface. - """) - ) -+ _(""" ++ """ + Please supply a password for the MySQL user 'roundcube'. + This password will be used by the Roundcube webmail + interface. -+ """) ++ """ + ) mysql_roundcube_password = utils.ask_question( @@ -69,7 +69,7 @@ - password=True, - confirm=True - ) -+ _("MySQL roundcube password"), ++ "MySQL roundcube password", + default=utils.generate_password(), + password=True, + confirm=True @@ -143,6 +143,15 @@ rcpath = '' for rc_path in rc_paths: +@@ -103,7 +109,7 @@ def execute(*args, **kw): + break + + if not os.path.isdir(rcpath): +- log.error(_("Roundcube installation path not found.")) ++ log.error("Roundcube installation path not found.") + return + + if os.access(rcpath + 'skins/enterprise/', os.R_OK): @@ -114,22 +120,22 @@ def execute(*args, **kw): rc_settings['skin'] = 'larry' @@ -190,12 +199,13 @@ - template_file = os.path.abspath(os.path.join(__file__, '..', '..', '..', 'share', 'templates', 'roundcubemail', '%s.tpl' % (want_file))) - if not template_file == None: -+ if template_file is not None: -+ # pylint: disable=logging-not-lazy - log.debug(_("Using template file %r") % (template_file), level=8) +- log.debug(_("Using template file %r") % (template_file), level=8) - fp = open(template_file, 'r') - template_definition = fp.read() - fp.close() ++ if template_file is not None: ++ # pylint: disable=logging-not-lazy ++ log.debug("Using template file %r" % (template_file), level=8) + filep = codecs.open(template_file, 'r', encoding='utf-8') + template_definition = filep.read() + filep.close() @@ -206,7 +216,7 @@ - _("Successfully compiled template %r, writing out to %r") % (template_file, want_file), - level=8 - ) -+ _("Successfully compiled template %r, writing out to %r") % ( ++ "Successfully compiled template %r, writing out to %r" % ( + template_file, + want_file + ), @@ -302,7 +312,7 @@ - _("MySQL root password"), - password=True - ) -+ mysql_root_password = utils.ask_question(_("MySQL root password"), password=True) ++ mysql_root_password = utils.ask_question("MySQL root password", password=True) data = """ [mysql] @@ -348,7 +358,15 @@ p1.stdout.close() p2.communicate() -@@ -267,11 +290,14 @@ password='%s' +@@ -260,18 +283,21 @@ password='%s' + elif os.path.isdir('/etc/roundcube/'): + rccpath = "/etc/roundcube" + else: +- log.warning(_("Cannot find the configuration directory for roundcube.")) ++ log.warning("Cannot find the configuration directory for roundcube.") + rccpath = None + + root_uid = 0 webserver_gid = None @@ -385,15 +403,18 @@ pass httpservice = 'httpd.service' -@@ -300,7 +328,7 @@ password='%s' +@@ -300,9 +328,9 @@ password='%s' elif os.path.isfile('/sbin/service'): subprocess.call(['/sbin/service', 'httpd', 'restart']) elif os.path.isfile('/usr/sbin/service'): - subprocess.call(['/usr/sbin/service','apache2','restart']) + subprocess.call(['/usr/sbin/service', 'apache2', 'restart']) else: - log.error(_("Could not start the webserver server service.")) +- log.error(_("Could not start the webserver server service.")) ++ log.error("Could not start the webserver server service.") + if os.path.isfile('/bin/systemctl'): + subprocess.call(['/bin/systemctl', 'enable', httpservice]) @@ -311,6 +339,6 @@ password='%s' elif os.path.isfile('/usr/sbin/update-rc.d'): subprocess.call(['/usr/sbin/update-rc.d', 'apache2', 'defaults']) @@ -402,7 +423,7 @@ - "webserver server service.")) - + log.error( -+ _("Could not configure to start on boot, the webserver server service.") ++ "Could not configure to start on boot, the webserver server service." + ) diff --git a/pykolab/translate.py b/pykolab/translate.py index 7bac219..d2eb0ca 100644
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.