A few Deprecation warnings handled

This commit is contained in:
prculley 2016-06-27 11:55:18 -05:00 committed by Nick Hall
parent 55c99fe718
commit d77f0562e8
2 changed files with 11 additions and 10 deletions

View File

@ -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 = '''
<ui>

View File

@ -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))