Merge pull request #133 from RossGammon/gi_require_version
PyGIWarning: importing without specifiying a version first
This commit is contained in:
commit
34c8cfdec4
@ -186,6 +186,8 @@ def show_settings():
|
||||
"""
|
||||
py_str = '%d.%d.%d' % sys.version_info[:3]
|
||||
try:
|
||||
import gi
|
||||
gi.require_version('Gtk', '3.0')
|
||||
from gi.repository import Gtk
|
||||
try:
|
||||
gtkver_str = '%d.%d.%d' % (Gtk.get_major_version(),
|
||||
@ -236,6 +238,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
|
||||
|
@ -37,6 +37,8 @@ mechanism for the user to edit address information.
|
||||
# GTK/Gnome modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gi
|
||||
gi.require_version('Gtk', '3.0')
|
||||
from gi.repository import Gtk
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -42,6 +42,8 @@ _ = glocale.translation.gettext
|
||||
# GNOME/GTK
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gi
|
||||
gi.require_version('PangoCairo', '1.0')
|
||||
from gi.repository import PangoCairo
|
||||
from gi.repository import GLib
|
||||
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user