From 9be31757e0410c7941796e69f738d6d729c07e54 Mon Sep 17 00:00:00 2001 From: Sam Manzi Date: Wed, 14 Dec 2016 07:42:36 +1100 Subject: [PATCH] 9801 Silence remaining PyGIWarning --- gramps/grampsapp.py | 2 ++ gramps/plugins/gramplet/gramplet.gpr.py | 2 ++ gramps/plugins/lib/libmetadata.py | 2 ++ gramps/plugins/lib/maps/constants.py | 2 ++ gramps/plugins/lib/maps/datelayer.py | 2 ++ gramps/plugins/lib/maps/dummylayer.py | 2 ++ gramps/plugins/lib/maps/dummynogps.py | 2 ++ gramps/plugins/lib/maps/geography.py | 2 ++ gramps/plugins/lib/maps/kmllayer.py | 2 ++ gramps/plugins/lib/maps/lifewaylayer.py | 2 ++ gramps/plugins/lib/maps/markerlayer.py | 2 ++ gramps/plugins/lib/maps/messagelayer.py | 2 ++ gramps/plugins/lib/maps/osmgps.py | 2 ++ gramps/plugins/lib/maps/selectionlayer.py | 2 ++ gramps/plugins/view/geography.gpr.py | 2 ++ 15 files changed, 30 insertions(+) diff --git a/gramps/grampsapp.py b/gramps/grampsapp.py index bec7d3cdb..c11aff7c9 100644 --- a/gramps/grampsapp.py +++ b/gramps/grampsapp.py @@ -250,6 +250,8 @@ def show_settings(): from gi import Repository repository = Repository.get_default() if repository.enumerate_versions("OsmGpsMap"): + import gi + gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap try: osmgpsmap_str = osmgpsmap._version diff --git a/gramps/plugins/gramplet/gramplet.gpr.py b/gramps/plugins/gramplet/gramplet.gpr.py index af74dfbfc..24954db03 100644 --- a/gramps/plugins/gramplet/gramplet.gpr.py +++ b/gramps/plugins/gramplet/gramplet.gpr.py @@ -384,6 +384,8 @@ try: from gi import Repository repository = Repository.get_default() if repository.enumerate_versions("GExiv2"): + import gi + gi.require_version('GExiv2', '0.10') from gi.repository import GExiv2 available = True else: diff --git a/gramps/plugins/lib/libmetadata.py b/gramps/plugins/lib/libmetadata.py index 2ff3d5b09..c0f53b17d 100644 --- a/gramps/plugins/lib/libmetadata.py +++ b/gramps/plugins/lib/libmetadata.py @@ -32,6 +32,8 @@ import os # #------------------------------------------------------------------------- from gi.repository import Gtk +import gi +gi.require_version('GExiv2', '0.10') from gi.repository import GExiv2 #------------------------------------------------------------------------- diff --git a/gramps/plugins/lib/maps/constants.py b/gramps/plugins/lib/maps/constants.py index 0b8eb6e6e..5e1057b18 100644 --- a/gramps/plugins/lib/maps/constants.py +++ b/gramps/plugins/lib/maps/constants.py @@ -28,6 +28,8 @@ from gramps.gen.lib import EventType import os from gramps.gen.const import HOME_DIR +import gi +gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap #------------------------------------------------------------------------- diff --git a/gramps/plugins/lib/maps/datelayer.py b/gramps/plugins/lib/maps/datelayer.py index aeb55e22a..59422db95 100644 --- a/gramps/plugins/lib/maps/datelayer.py +++ b/gramps/plugins/lib/maps/datelayer.py @@ -60,6 +60,8 @@ import cairo #------------------------------------------------------------------------- try: + import gi + gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap except: raise diff --git a/gramps/plugins/lib/maps/dummylayer.py b/gramps/plugins/lib/maps/dummylayer.py index f8e14dc3a..73b4a27ab 100644 --- a/gramps/plugins/lib/maps/dummylayer.py +++ b/gramps/plugins/lib/maps/dummylayer.py @@ -49,6 +49,8 @@ _LOG = logging.getLogger("maps.dummylayer") #------------------------------------------------------------------------- try: + import gi + gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap except: raise diff --git a/gramps/plugins/lib/maps/dummynogps.py b/gramps/plugins/lib/maps/dummynogps.py index 504106c07..dff9f215b 100644 --- a/gramps/plugins/lib/maps/dummynogps.py +++ b/gramps/plugins/lib/maps/dummynogps.py @@ -49,6 +49,8 @@ _LOG = logging.getLogger("maps.dummynogps") #------------------------------------------------------------------------- try: + import gi + gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap except: raise diff --git a/gramps/plugins/lib/maps/geography.py b/gramps/plugins/lib/maps/geography.py index 8453f1903..7574880c5 100644 --- a/gramps/plugins/lib/maps/geography.py +++ b/gramps/plugins/lib/maps/geography.py @@ -62,6 +62,8 @@ from gramps.gui.editors import EditPlace, EditEvent, EditFamily, EditPerson from gramps.gui.selectors.selectplace import SelectPlace from gramps.gen.constfunc import conv_to_unicode +import gi +gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap from . import constants from .osmgps import OsmGps diff --git a/gramps/plugins/lib/maps/kmllayer.py b/gramps/plugins/lib/maps/kmllayer.py index 443e3554f..f7b879ebb 100644 --- a/gramps/plugins/lib/maps/kmllayer.py +++ b/gramps/plugins/lib/maps/kmllayer.py @@ -63,6 +63,8 @@ from .libkml import Kml #------------------------------------------------------------------------- try: + import gi + gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap except: raise diff --git a/gramps/plugins/lib/maps/lifewaylayer.py b/gramps/plugins/lib/maps/lifewaylayer.py index f1f5c5f1b..9809b1e53 100644 --- a/gramps/plugins/lib/maps/lifewaylayer.py +++ b/gramps/plugins/lib/maps/lifewaylayer.py @@ -59,6 +59,8 @@ import cairo #------------------------------------------------------------------------- try: + import gi + gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap except: raise diff --git a/gramps/plugins/lib/maps/markerlayer.py b/gramps/plugins/lib/maps/markerlayer.py index eaba708e2..75708a15a 100644 --- a/gramps/plugins/lib/maps/markerlayer.py +++ b/gramps/plugins/lib/maps/markerlayer.py @@ -67,6 +67,8 @@ _LOG = logging.getLogger("GeoGraphy.markerlayer") #------------------------------------------------------------------------- try: + import gi + gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap except: raise diff --git a/gramps/plugins/lib/maps/messagelayer.py b/gramps/plugins/lib/maps/messagelayer.py index e5ccd96e0..af3b542a7 100644 --- a/gramps/plugins/lib/maps/messagelayer.py +++ b/gramps/plugins/lib/maps/messagelayer.py @@ -60,6 +60,8 @@ from gi.repository import Pango, PangoCairo #------------------------------------------------------------------------- try: + import gi + gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap except: raise diff --git a/gramps/plugins/lib/maps/osmgps.py b/gramps/plugins/lib/maps/osmgps.py index fdb3501cf..af1013cb1 100644 --- a/gramps/plugins/lib/maps/osmgps.py +++ b/gramps/plugins/lib/maps/osmgps.py @@ -72,6 +72,8 @@ from gramps.gen.constfunc import get_env_var #------------------------------------------------------------------------- try: + import gi + gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap except: raise diff --git a/gramps/plugins/lib/maps/selectionlayer.py b/gramps/plugins/lib/maps/selectionlayer.py index 5bfcf8d63..dcde19c02 100644 --- a/gramps/plugins/lib/maps/selectionlayer.py +++ b/gramps/plugins/lib/maps/selectionlayer.py @@ -50,6 +50,8 @@ _LOG = logging.getLogger("maps.selectionlayer") #------------------------------------------------------------------------- try: + import gi + gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap except: raise diff --git a/gramps/plugins/view/geography.gpr.py b/gramps/plugins/view/geography.gpr.py index 3af5f436a..5e0828aa6 100644 --- a/gramps/plugins/view/geography.gpr.py +++ b/gramps/plugins/view/geography.gpr.py @@ -44,6 +44,8 @@ repository = Repository.get_default() if repository.enumerate_versions("OsmGpsMap"): try : # current osmgpsmap support GTK3 + import gi + gi.require_version('OsmGpsMap', '1.0') from gi.repository import OsmGpsMap as osmgpsmap if osmgpsmap._version < '0.8': _LOG.warning( _("OsmGpsMap module not loaded. "