From d77f0562e8d26fc0dcf38c7f4c16873262b4c35a Mon Sep 17 00:00:00 2001 From: prculley Date: Mon, 27 Jun 2016 11:55:18 -0500 Subject: [PATCH] A few Deprecation warnings handled --- gramps/gui/widgets/styledtexteditor.py | 5 +++-- gramps/plugins/importer/importvcard.py | 16 ++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/gramps/gui/widgets/styledtexteditor.py b/gramps/gui/widgets/styledtexteditor.py index f67f84329..59a63f9dd 100644 --- a/gramps/gui/widgets/styledtexteditor.py +++ b/gramps/gui/widgets/styledtexteditor.py @@ -71,8 +71,9 @@ from ..actiongroup import ActionGroup # #------------------------------------------------------------------------- if has_display(): - HAND_CURSOR = Gdk.Cursor.new(Gdk.CursorType.HAND2) - REGULAR_CURSOR = Gdk.Cursor.new(Gdk.CursorType.XTERM) + display = Gdk.Display.get_default() + HAND_CURSOR = Gdk.Cursor.new_for_display(display, Gdk.CursorType.HAND2) + REGULAR_CURSOR = Gdk.Cursor.new_for_display(display, Gdk.CursorType.XTERM) FORMAT_TOOLBAR = ''' diff --git a/gramps/plugins/importer/importvcard.py b/gramps/plugins/importer/importvcard.py index ecfd3a7c1..dadd1e93e 100644 --- a/gramps/plugins/importer/importvcard.py +++ b/gramps/plugins/importer/importvcard.py @@ -289,7 +289,7 @@ class VCardParser: # Included cause VCards made by Gramps have this prop. pass else: - LOG.warn("Token >%s< unknown. line skipped: %s" % + LOG.warning("Token >%s< unknown. line skipped: %s" % (fields[0],line)) def finish_person(self): @@ -303,8 +303,8 @@ class VCardParser: """A VCard for another person is started.""" if self.person is not None: self.finish_person() - LOG.warn("BEGIN property not properly closed by END property, " - "Gramps can't cope with nested VCards.") + LOG.warning("BEGIN property not properly closed by END property, " + "Gramps can't cope with nested VCards.") self.person = Person() self.formatted_name = '' self.name_parts = '' @@ -333,15 +333,15 @@ class VCardParser: Returns True on success, False on failure. """ if not self.name_parts.strip(): - LOG.warn("VCard is malformed missing the compulsory N property, " - "so there is no name; skip it.") + LOG.warning("VCard is malformed missing the compulsory N property," + " so there is no name; skip it.") return False if not self.formatted_name: - LOG.warn("VCard is malformed missing the compulsory FN property, " - "get name from N alone.") + LOG.warning("VCard is malformed missing the compulsory FN property" + ", get name from N alone.") data_fields = self.split_unescaped(self.name_parts, ';') if len(data_fields) != 5: - LOG.warn("VCard is malformed wrong number of name components.") + LOG.warning("VCard is malformed wrong number of name components.") name = Name() name.set_type(NameType(NameType.BIRTH))