[totem] opensubtitles: Fix GI deprecation warnings



commit d2836da5051e0bc6e8b876ff1873ae3622569ee0
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Nov 3 15:36:03 2015 +0100

    opensubtitles: Fix GI deprecation warnings
    
    /usr/lib64/totem/plugins/opensubtitles/opensubtitles.py:4: PyGIWarning: Peas was imported without 
specifying a version first. Use gi.require_version('Peas', '1.0') before import to ensure that the right 
version gets loaded.
      from gi.repository import Peas, Gtk, Gdk # pylint: disable-msg=E0611
    
    /usr/lib64/totem/plugins/opensubtitles/opensubtitles.py:4: PyGIWarning: Gtk was imported without 
specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right 
version gets loaded.
      from gi.repository import Peas, Gtk, Gdk # pylint: disable-msg=E0611
    
    /usr/lib64/totem/plugins/opensubtitles/opensubtitles.py:5: PyGIWarning: Totem was imported without 
specifying a version first. Use gi.require_version('Totem', '1.0') before import to ensure that the right 
version gets loaded.
      from gi.repository import Gio, Pango, Totem # pylint: disable-msg=E0611
    
    https://bugzilla.gnome.org/show_bug.cgi?id=757526

 src/plugins/opensubtitles/opensubtitles.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/opensubtitles/opensubtitles.py b/src/plugins/opensubtitles/opensubtitles.py
index e58636b..f2c39e3 100644
--- a/src/plugins/opensubtitles/opensubtitles.py
+++ b/src/plugins/opensubtitles/opensubtitles.py
@@ -1,5 +1,9 @@
 # -*- coding: utf-8 -*-
 
+import gi
+gi.require_version('Peas', '1.0')
+gi.require_version('Gtk', '3.0')
+gi.require_version('Totem', '1.0')
 from gi.repository import GLib, GObject # pylint: disable-msg=E0611
 from gi.repository import Peas, Gtk, Gdk # pylint: disable-msg=E0611
 from gi.repository import Gio, Pango, Totem # pylint: disable-msg=E0611


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]