From 42d1f0947bbc14bca74b7a8dd97d189a2804c783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Rapinat?= Date: Fri, 17 Jan 2014 18:05:56 +0100 Subject: [PATCH] 7370: Citation sidebar filter raises unicode exception with python3 --- .../filters/sidebar/_citationsidebarfilter.py | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/gramps/gui/filters/sidebar/_citationsidebarfilter.py b/gramps/gui/filters/sidebar/_citationsidebarfilter.py index 4c08d1411..679520b7f 100644 --- a/gramps/gui/filters/sidebar/_citationsidebarfilter.py +++ b/gramps/gui/filters/sidebar/_citationsidebarfilter.py @@ -21,14 +21,6 @@ # $Id$ -#------------------------------------------------------------------------- -# -# Python modules -# -#------------------------------------------------------------------------- -from gramps.gen.const import GRAMPS_LOCALE as glocale -_ = glocale.translation.sgettext - #------------------------------------------------------------------------- # # gtk @@ -41,6 +33,11 @@ from gi.repository import Gtk # GRAMPS modules # #------------------------------------------------------------------------- +from gramps.gen.const import GRAMPS_LOCALE as glocale +_ = glocale.translation.sgettext + +from gramps.gen.constfunc import cuni + from ...widgets import MonitoredMenu, DateEntry, BasicEntry from gramps.gen.lib import Citation from .. import build_filter_model @@ -138,15 +135,15 @@ class CitationSidebarFilter(SidebarFilter): self.generic.set_active(0) def get_filter(self): - src_id = unicode(self.filter_src_id.get_text()).strip() - src_title = unicode(self.filter_src_title.get_text()).strip() - src_author = unicode(self.filter_src_author.get_text()).strip() - src_abbr = unicode(self.filter_src_abbr.get_text()).strip() - src_pub = unicode(self.filter_src_pub.get_text()).strip() - src_note = unicode(self.filter_src_note.get_text()).strip() - gid = unicode(self.filter_id.get_text()).strip() - page = unicode(self.filter_page.get_text()).strip() - date = unicode(self.filter_date.get_text()).strip() + src_id = cuni(self.filter_src_id.get_text()).strip() + src_title = cuni(self.filter_src_title.get_text()).strip() + src_author = cuni(self.filter_src_author.get_text()).strip() + src_abbr = cuni(self.filter_src_abbr.get_text()).strip() + src_pub = cuni(self.filter_src_pub.get_text()).strip() + src_note = cuni(self.filter_src_note.get_text()).strip() + gid = cuni(self.filter_id.get_text()).strip() + page = cuni(self.filter_page.get_text()).strip() + date = cuni(self.filter_date.get_text()).strip() gid = cuni(self.filter_id.get_text()).strip() page = cuni(self.filter_page.get_text()).strip() date = cuni(self.filter_date.get_text()).strip()