From 6eef87e59cb256ca8a4e756f45fed7284b852a01 Mon Sep 17 00:00:00 2001 From: Gilles Dartiguelongue Date: Fri, 18 May 2018 11:16:31 +0200 Subject: Fix window computation not being int, closes #8 --- elogv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elogv b/elogv index 9ead73b..86c67c2 100755 --- a/elogv +++ b/elogv @@ -619,8 +619,8 @@ class ElogViewer: def show_help(self): # Setup help window - helpwin_height = self.height / 3 * 2 - helpwin_corner = (self.height / 6, self.width// 2 - 40) + helpwin_height = self.height // 3 * 2 + helpwin_corner = (self.height // 6, self.width // 2 - 40) helpwin = curses.newwin(helpwin_height, 80, helpwin_corner[0], helpwin_corner[1]) helplines = helptext.splitlines() -- cgit v1.2.3-65-gdbad From a98c6ba7eabcdeafaf7bf27263073b77fd26a0d3 Mon Sep 17 00:00:00 2001 From: Gilles Dartiguelongue Date: Fri, 18 May 2018 11:17:46 +0200 Subject: Use unicode returning gettext functions, refs #8 There is a big fat warning in python documentation [1] hinting that l*gettext might be eventually deprecated. [1] https://docs.python.org/3.6/library/gettext.html?highlight=gettext%20lgettext#gettext.lgettext --- elogv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/elogv b/elogv index 86c67c2..e579e01 100755 --- a/elogv +++ b/elogv @@ -104,7 +104,8 @@ if reported_bad_locales: # encoding, not encoded with the same codeset used in the translation # file gettext.textdomain('elogv') -_ = gettext.lgettext +gettext.bind_textdomain_codeset('elogv', locale.getpreferredencoding()) +_ = gettext.gettext # This text is used on the in-line help helptext = _(""" -- cgit v1.2.3-65-gdbad