9801 Silence remaining PyGIWarning

This commit is contained in:
Sam Manzi 2016-12-14 07:42:36 +11:00
parent cc50e4e972
commit 9be31757e0
No known key found for this signature in database
GPG Key ID: F4A16068AE36B402
15 changed files with 30 additions and 0 deletions

View File

@ -250,6 +250,8 @@ def show_settings():
from gi import Repository from gi import Repository
repository = Repository.get_default() repository = Repository.get_default()
if repository.enumerate_versions("OsmGpsMap"): if repository.enumerate_versions("OsmGpsMap"):
import gi
gi.require_version('OsmGpsMap', '1.0')
from gi.repository import OsmGpsMap as osmgpsmap from gi.repository import OsmGpsMap as osmgpsmap
try: try:
osmgpsmap_str = osmgpsmap._version osmgpsmap_str = osmgpsmap._version

View File

@ -384,6 +384,8 @@ try:
from gi import Repository from gi import Repository
repository = Repository.get_default() repository = Repository.get_default()
if repository.enumerate_versions("GExiv2"): if repository.enumerate_versions("GExiv2"):
import gi
gi.require_version('GExiv2', '0.10')
from gi.repository import GExiv2 from gi.repository import GExiv2
available = True available = True
else: else:

View File

@ -32,6 +32,8 @@ import os
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gi.repository import Gtk from gi.repository import Gtk
import gi
gi.require_version('GExiv2', '0.10')
from gi.repository import GExiv2 from gi.repository import GExiv2
#------------------------------------------------------------------------- #-------------------------------------------------------------------------

View File

@ -28,6 +28,8 @@
from gramps.gen.lib import EventType from gramps.gen.lib import EventType
import os import os
from gramps.gen.const import HOME_DIR from gramps.gen.const import HOME_DIR
import gi
gi.require_version('OsmGpsMap', '1.0')
from gi.repository import OsmGpsMap as osmgpsmap from gi.repository import OsmGpsMap as osmgpsmap
#------------------------------------------------------------------------- #-------------------------------------------------------------------------

View File

@ -60,6 +60,8 @@ import cairo
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
try: try:
import gi
gi.require_version('OsmGpsMap', '1.0')
from gi.repository import OsmGpsMap as osmgpsmap from gi.repository import OsmGpsMap as osmgpsmap
except: except:
raise raise

View File

@ -49,6 +49,8 @@ _LOG = logging.getLogger("maps.dummylayer")
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
try: try:
import gi
gi.require_version('OsmGpsMap', '1.0')
from gi.repository import OsmGpsMap as osmgpsmap from gi.repository import OsmGpsMap as osmgpsmap
except: except:
raise raise

View File

@ -49,6 +49,8 @@ _LOG = logging.getLogger("maps.dummynogps")
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
try: try:
import gi
gi.require_version('OsmGpsMap', '1.0')
from gi.repository import OsmGpsMap as osmgpsmap from gi.repository import OsmGpsMap as osmgpsmap
except: except:
raise raise

View File

@ -62,6 +62,8 @@ from gramps.gui.editors import EditPlace, EditEvent, EditFamily, EditPerson
from gramps.gui.selectors.selectplace import SelectPlace from gramps.gui.selectors.selectplace import SelectPlace
from gramps.gen.constfunc import conv_to_unicode from gramps.gen.constfunc import conv_to_unicode
import gi
gi.require_version('OsmGpsMap', '1.0')
from gi.repository import OsmGpsMap as osmgpsmap from gi.repository import OsmGpsMap as osmgpsmap
from . import constants from . import constants
from .osmgps import OsmGps from .osmgps import OsmGps

View File

@ -63,6 +63,8 @@ from .libkml import Kml
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
try: try:
import gi
gi.require_version('OsmGpsMap', '1.0')
from gi.repository import OsmGpsMap as osmgpsmap from gi.repository import OsmGpsMap as osmgpsmap
except: except:
raise raise

View File

@ -59,6 +59,8 @@ import cairo
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
try: try:
import gi
gi.require_version('OsmGpsMap', '1.0')
from gi.repository import OsmGpsMap as osmgpsmap from gi.repository import OsmGpsMap as osmgpsmap
except: except:
raise raise

View File

@ -67,6 +67,8 @@ _LOG = logging.getLogger("GeoGraphy.markerlayer")
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
try: try:
import gi
gi.require_version('OsmGpsMap', '1.0')
from gi.repository import OsmGpsMap as osmgpsmap from gi.repository import OsmGpsMap as osmgpsmap
except: except:
raise raise

View File

@ -60,6 +60,8 @@ from gi.repository import Pango, PangoCairo
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
try: try:
import gi
gi.require_version('OsmGpsMap', '1.0')
from gi.repository import OsmGpsMap as osmgpsmap from gi.repository import OsmGpsMap as osmgpsmap
except: except:
raise raise

View File

@ -72,6 +72,8 @@ from gramps.gen.constfunc import get_env_var
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
try: try:
import gi
gi.require_version('OsmGpsMap', '1.0')
from gi.repository import OsmGpsMap as osmgpsmap from gi.repository import OsmGpsMap as osmgpsmap
except: except:
raise raise

View File

@ -50,6 +50,8 @@ _LOG = logging.getLogger("maps.selectionlayer")
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
try: try:
import gi
gi.require_version('OsmGpsMap', '1.0')
from gi.repository import OsmGpsMap as osmgpsmap from gi.repository import OsmGpsMap as osmgpsmap
except: except:
raise raise

View File

@ -44,6 +44,8 @@ repository = Repository.get_default()
if repository.enumerate_versions("OsmGpsMap"): if repository.enumerate_versions("OsmGpsMap"):
try : try :
# current osmgpsmap support GTK3 # current osmgpsmap support GTK3
import gi
gi.require_version('OsmGpsMap', '1.0')
from gi.repository import OsmGpsMap as osmgpsmap from gi.repository import OsmGpsMap as osmgpsmap
if osmgpsmap._version < '0.8': if osmgpsmap._version < '0.8':
_LOG.warning( _("OsmGpsMap module not loaded. " _LOG.warning( _("OsmGpsMap module not loaded. "