From 81eda27f5da0a4acf9a9ec2fdf18ca924532fb92 Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Mon, 12 Oct 2015 14:59:09 +0200 Subject: [PATCH] Geography : 0008982: Gobject Instrospection displays a warning and ask to set a version to load. --- 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 | 10 +++------- 12 files changed, 25 insertions(+), 7 deletions(-) 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 55ee70a3a..dd7b53ac3 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 62f01fc73..19df3b789 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 784f178a8..b6b1419fe 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 17bdc9e4f..66e342bda 100644 --- a/gramps/plugins/view/geography.gpr.py +++ b/gramps/plugins/view/geography.gpr.py @@ -44,14 +44,10 @@ 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. " - "OsmGpsMap must be >= 0.8. yours is %s") % - osmgpsmap._version) - else: - OSMGPSMAP = True - _LOG.info("OsmGpsMap loaded, version : " + osmgpsmap._version) + OSMGPSMAP = True except: pass