From b4b9300f6db825bde2ba347162e64da13d5e5fd2 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Mon, 25 Mar 2013 13:35:08 +0000 Subject: [PATCH] Fix literals. Use logging for warnings. svn: r21739 --- gramps/gui/widgets/grampletbar.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gramps/gui/widgets/grampletbar.py b/gramps/gui/widgets/grampletbar.py index b91b09862..5036d4d29 100644 --- a/gramps/gui/widgets/grampletbar.py +++ b/gramps/gui/widgets/grampletbar.py @@ -24,13 +24,21 @@ """ Module that implements the gramplet bar fuctionality. """ +from __future__ import unicode_literals + +#------------------------------------------------------------------------- +# +# Set up logging +# +#------------------------------------------------------------------------- +import logging +LOG = logging.getLogger('.grampletbar') + #------------------------------------------------------------------------- # # Python modules # #------------------------------------------------------------------------- -from __future__ import print_function - from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.get_translation().gettext import time @@ -195,7 +203,7 @@ class GrampletBar(Gtk.Notebook): try: fp = io.open(filename, "w", encoding='utf-8') except IOError: - print("Failed writing '%s'; gramplets not saved" % filename) + LOG.warning("Failed writing '%s'; gramplets not saved" % filename) return fp.write(";; Gramplet bar configuration file" + NL) fp.write((";; Automatically created at %s" % @@ -281,7 +289,7 @@ class GrampletBar(Gtk.Notebook): gramplet = make_requested_gramplet(TabGramplet, self, all_opts, self.dbstate, self.uistate) if not gramplet: - print("Problem creating ", gname) + LOG.warning("Problem creating ", gname) return page_num = self.__add_tab(gramplet)