aboutsummaryrefslogtreecommitdiffstats
path: root/src/msec/msecgui.py
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageialinux-online.org>2015-07-05 11:54:47 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2015-07-25 17:24:10 +0200
commit4fac47893db3ede8b27c2d682b1f6d9165f180a8 (patch)
treeb60fcca71959fc6599c2464ae39cf95c43292d91 /src/msec/msecgui.py
parent5134f51bbc3bcc9834cf8a92e1e9b3ab08d04782 (diff)
downloadmsec-4fac47893db3ede8b27c2d682b1f6d9165f180a8.tar
msec-4fac47893db3ede8b27c2d682b1f6d9165f180a8.tar.gz
msec-4fac47893db3ede8b27c2d682b1f6d9165f180a8.tar.bz2
msec-4fac47893db3ede8b27c2d682b1f6d9165f180a8.tar.xz
msec-4fac47893db3ede8b27c2d682b1f6d9165f180a8.zip
Add a Narg function to deal the encoding strings. #mga13837
v1: Thierry Vignaud v2: improved by patpoteur
Diffstat (limited to 'src/msec/msecgui.py')
-rwxr-xr-xsrc/msec/msecgui.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/msec/msecgui.py b/src/msec/msecgui.py
index 7a2ceb7..d468b15 100755
--- a/src/msec/msecgui.py
+++ b/src/msec/msecgui.py
@@ -14,6 +14,8 @@ from textwrap import wrap
from threading import Thread
import time
+from config import Narg
+
# PyGTK
import warnings
warnings.filterwarnings('error', module='gtk')
@@ -379,14 +381,14 @@ class MsecGui:
# TODO: FIX
for name, changes in allchanges:
- label = Gtk.Label(label=_('<b>%s:</b> <i>%s</i>\n') % (name, changes))
+ label = Gtk.Label(label=_('<b>%s:</b> <i>%s</i>\n') % (Narg(name), Narg(changes)))
label.set_use_markup(True)
label.set_property("xalign", 0.0)
vbox.pack_start(label, False, False, padding=DEFAULT_SPACING)
# see if there were any changes to system files
for msg in messages['info']:
if msg.find(config.MODIFICATIONS_FOUND) != -1 or msg.find(config.MODIFICATIONS_NOT_FOUND) != -1:
- label = Gtk.Label(label=_("<b>MSEC test run results:</b> <i>%s</i>") % msg)
+ label = Gtk.Label(label=_("<b>MSEC test run results:</b> <i>%s</i>") % Narg(msg))
label.set_line_wrap(True)
label.set_use_markup(True)
label.set_property("xalign", 0.0)
@@ -659,7 +661,7 @@ class MsecGui:
for check, logfile, updated_n, updated in tools.periodic_check_status(log):
if not updated:
updated = _("Never")
- label = Gtk.Label(label=_("Check: %s. Last run: %s") % (check, updated))
+ label = Gtk.Label(label=_("Check: %s. Last run: %s") % (Narg(check), Narg(updated)))
label.set_property("xalign", 0.0)
table.attach(label, 2, 3, row, row + 1, Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, 0, 0, 0)
@@ -691,7 +693,7 @@ class MsecGui:
with open(logfile, "r") as fd:
data = fd.readlines()
except:
- data = [_("Unable to read log file: %s") % sys.exc_value]
+ data = [_("Unable to read log file: %s") % Narg(sys.exc_value)]
dialog = Gtk.Dialog(_("Periodic check results"),
self.window,
0,
@@ -724,7 +726,7 @@ class MsecGui:
flags=0,
type=Gtk.MessageType.INFO,
buttons=Gtk.ButtonsType.YES_NO)
- dialog.set_markup(_("Do you want to run the <b>%s</b> periodic check? Please note that it could take a considerable time to finish.") % check)
+ dialog.set_markup(_("Do you want to run the <b>%s</b> periodic check? Please note that it could take a considerable time to finish.") % Narg(check))
dialog.show_all()
ret = dialog.run()
dialog.destroy()
@@ -1643,6 +1645,11 @@ class MsecGui:
val_def = conf_def.get(param)
+ for i in [param, descr, value]:
+ i = Narg(i)
+ # if not (type(i) == unicode) and not config.try_decode(i):
+ # i = i.decode(config.SYS_ENC)
+
# asks for new parameter value
dialog = Gtk.Dialog(_("Select new value for %s") % (param),
self.window, 0,