[gedit] plugins: quiet some PyGI warnings



commit 9db7f0273db603ce16c55d38f0e340514619f498
Author: Sébastien Lafargue <slafargue gnome org>
Date:   Tue Jun 30 23:12:19 2015 +0200

    plugins: quiet some PyGI warnings
    
    because of some warning about module's requirements, we need
    to add some version information before loading modules.
    
    ( see https://bugzilla.gnome.org/show_bug.cgi?id=727379 )

 plugins/externaltools/tools/appactivatable.py    |    2 ++
 plugins/externaltools/tools/windowactivatable.py |    3 +++
 plugins/pythonconsole/pythonconsole/__init__.py  |    5 +++++
 plugins/quickopen/quickopen/__init__.py          |    2 ++
 plugins/snippets/snippets/appactivatable.py      |    3 ++-
 plugins/snippets/snippets/windowactivatable.py   |    2 ++
 6 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/plugins/externaltools/tools/appactivatable.py b/plugins/externaltools/tools/appactivatable.py
index 0724065..74f2a78 100644
--- a/plugins/externaltools/tools/appactivatable.py
+++ b/plugins/externaltools/tools/appactivatable.py
@@ -16,6 +16,8 @@
 #    along with this program; if not, write to the Free Software
 #    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
+import gi
+gi.require_version('Gtk', '3.0')
 from gi.repository import GLib, Gio, GObject, Gtk, Gdk, Gedit
 from .library import ToolLibrary
 from .manager import Manager
diff --git a/plugins/externaltools/tools/windowactivatable.py 
b/plugins/externaltools/tools/windowactivatable.py
index f4d25d4..ef1971b 100644
--- a/plugins/externaltools/tools/windowactivatable.py
+++ b/plugins/externaltools/tools/windowactivatable.py
@@ -18,6 +18,9 @@
 
 __all__ = ('ExternalToolsPlugin', 'OutputPanel', 'Capture', 'UniqueById')
 
+import gi
+gi.require_version('Gtk', '3.0')
+gi.require_version('PeasGtk', '1.0')
 from gi.repository import GLib, Gio, GObject, Gtk, Gedit, PeasGtk
 from .library import ToolLibrary
 from .outputpanel import OutputPanel
diff --git a/plugins/pythonconsole/pythonconsole/__init__.py b/plugins/pythonconsole/pythonconsole/__init__.py
index 5343725..eb218fd 100644
--- a/plugins/pythonconsole/pythonconsole/__init__.py
+++ b/plugins/pythonconsole/pythonconsole/__init__.py
@@ -23,6 +23,11 @@
 # Bits from gedit Python Console Plugin
 #     Copyrignt (C), 2005 Raphaël Slinckx
 
+import gi
+gi.require_version('Gtk', '3.0')
+gi.require_version('PeasGtk', '1.0')
+gi.require_version('Gedit', '3.0')
+gi.require_version('Peas', '1.0')
 from gi.repository import GObject, Gtk, Gedit, Peas, PeasGtk
 
 from .console import PythonConsole
diff --git a/plugins/quickopen/quickopen/__init__.py b/plugins/quickopen/quickopen/__init__.py
index 6cff2d1..41373e9 100644
--- a/plugins/quickopen/quickopen/__init__.py
+++ b/plugins/quickopen/quickopen/__init__.py
@@ -17,6 +17,8 @@
 
 from .popup import Popup
 import os
+import gi
+gi.require_version('Gtk', '3.0')
 from gi.repository import GObject, Gio, GLib, Gtk, Gedit
 from .virtualdirs import RecentDocumentsDirectory
 from .virtualdirs import CurrentDocumentsDirectory
diff --git a/plugins/snippets/snippets/appactivatable.py b/plugins/snippets/snippets/appactivatable.py
index 13cd170..f4568a6 100644
--- a/plugins/snippets/snippets/appactivatable.py
+++ b/plugins/snippets/snippets/appactivatable.py
@@ -16,7 +16,8 @@
 #    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 import os
-
+import gi
+gi.require_version('Gtk', '3.0')
 from gi.repository import Gedit, Gtk, Gdk, GObject, Gio, GLib
 import platform
 
diff --git a/plugins/snippets/snippets/windowactivatable.py b/plugins/snippets/snippets/windowactivatable.py
index d7dc573..41c96c2 100644
--- a/plugins/snippets/snippets/windowactivatable.py
+++ b/plugins/snippets/snippets/windowactivatable.py
@@ -15,6 +15,8 @@
 #    along with this program; if not, write to the Free Software
 #    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
+import gi
+gi.require_version('Gtk', '3.0')
 from gi.repository import Gtk, Gedit, GObject
 
 from .snippet import Snippet


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