[gedit-plugins] Move the gi.required_version in the __init__ files where possible



commit 908ff5b1c8482993cdf15115b7dbeea4ceda835f
Author: Paolo Borelli <pborelli gnome org>
Date:   Mon Aug 17 10:32:19 2015 +0200

    Move the gi.required_version in the __init__ files where possible

 plugins/colorschemer/schemer/__init__.py       |    1 +
 plugins/commander/commander/__init__.py        |    4 ++++
 plugins/commander/commander/appactivatable.py  |    3 +--
 plugins/dashboard/dashboard/__init__.py        |    2 ++
 plugins/git/git/__init__.py                    |    5 +++++
 plugins/git/git/appactivatable.py              |    2 --
 plugins/multiedit/multiedit/__init__.py        |    5 +++++
 plugins/multiedit/multiedit/viewactivatable.py |    2 --
 plugins/terminal/terminal.py                   |    8 ++++++--
 9 files changed, 24 insertions(+), 8 deletions(-)
---
diff --git a/plugins/colorschemer/schemer/__init__.py b/plugins/colorschemer/schemer/__init__.py
index 9a56914..4307b01 100644
--- a/plugins/colorschemer/schemer/__init__.py
+++ b/plugins/colorschemer/schemer/__init__.py
@@ -20,6 +20,7 @@
 
 import gi
 gi.require_version('Gedit', '3.0')
+gi.require_version('Gtk', '3.0')
 from gi.repository import GObject, Gio, Gedit, Gtk
 import os
 from .schemer import GUI
diff --git a/plugins/commander/commander/__init__.py b/plugins/commander/commander/__init__.py
index 57fddd3..64cd19b 100644
--- a/plugins/commander/commander/__init__.py
+++ b/plugins/commander/commander/__init__.py
@@ -27,6 +27,10 @@ path = os.path.dirname(__file__)
 if not path in sys.path:
     sys.path.insert(0, path)
 
+import gi
+gi.require_version('Gedit', '3.0')
+gi.require_version('Gtk', '3.0')
+
 from appactivatable import CommanderAppActivatable
 from windowactivatable import CommanderWindowActivatable
 
diff --git a/plugins/commander/commander/appactivatable.py b/plugins/commander/commander/appactivatable.py
index a4edd6d..0f1998c 100644
--- a/plugins/commander/commander/appactivatable.py
+++ b/plugins/commander/commander/appactivatable.py
@@ -19,12 +19,11 @@
 #  Foundation, Inc., 51 Franklin Street, Fifth Floor,
 #  Boston, MA 02110-1301, USA.
 
-import gi
-gi.require_version('Gedit', '3.0')
 from gi.repository import GLib, GObject, Gio, Gedit
 import sys, os
 import commander.commands as commands
 
+
 class CommanderAppActivatable(GObject.Object, Gedit.AppActivatable):
 
     app = GObject.Property(type=Gedit.App)
diff --git a/plugins/dashboard/dashboard/__init__.py b/plugins/dashboard/dashboard/__init__.py
index 0ed501c..acbe0d6 100644
--- a/plugins/dashboard/dashboard/__init__.py
+++ b/plugins/dashboard/dashboard/__init__.py
@@ -20,10 +20,12 @@
 #
 
 import gi
+gi.require_version('Gedit', '3.0')
 gi.require_version('Zeitgeist', '2.0')
 from gi.repository import GObject, Gedit
 from .dashboard import Dashboard
 
+
 class DashboardWindowActivatable(GObject.Object, Gedit.WindowActivatable):
 
     window = GObject.Property(type=Gedit.Window)
diff --git a/plugins/git/git/__init__.py b/plugins/git/git/__init__.py
index db522c8..29b6967 100644
--- a/plugins/git/git/__init__.py
+++ b/plugins/git/git/__init__.py
@@ -17,6 +17,11 @@
 #  Foundation, Inc.  51 Franklin Street, Fifth Floor, Boston, MA
 #  02110-1301 USA.
 
+import gi
+gi.require_version('Gedit', '3.0')
+gi.require_version('Gtk', '3.0')
+gi.require_version('Ggit', '1.0')
+
 from .appactivatable import GitAppActivatable
 from .viewactivatable import GitViewActivatable
 from .windowactivatable import GitWindowActivatable
diff --git a/plugins/git/git/appactivatable.py b/plugins/git/git/appactivatable.py
index cd1937a..d746c21 100644
--- a/plugins/git/git/appactivatable.py
+++ b/plugins/git/git/appactivatable.py
@@ -17,8 +17,6 @@
 #  Foundation, Inc.  51 Franklin Street, Fifth Floor, Boston, MA
 #  02110-1301 USA.
 
-import gi
-gi.require_version('Ggit', '1.0')
 from gi.repository import GLib, GObject, Gio, Gedit, Ggit
 
 
diff --git a/plugins/multiedit/multiedit/__init__.py b/plugins/multiedit/multiedit/__init__.py
index 4a7df2b..29f9c51 100644
--- a/plugins/multiedit/multiedit/__init__.py
+++ b/plugins/multiedit/multiedit/__init__.py
@@ -19,6 +19,11 @@
 #  Foundation, Inc., 51 Franklin Street, Fifth Floor,
 #  Boston, MA 02110-1301, USA.
 
+import gi
+gi.require_version('Gedit', '3.0')
+gi.require_version('Gtk', '3.0')
+gi.require_version('PangoCairo', '1.0')
+
 from .appactivatable import MultiEditAppActivatable
 from .viewactivatable import MultiEditViewActivatable
 from .windowactivatable import MultiEditWindowActivatable
diff --git a/plugins/multiedit/multiedit/viewactivatable.py b/plugins/multiedit/multiedit/viewactivatable.py
index f26c20f..beff205 100644
--- a/plugins/multiedit/multiedit/viewactivatable.py
+++ b/plugins/multiedit/multiedit/viewactivatable.py
@@ -22,8 +22,6 @@
 import re, time, gettext
 import xml.sax.saxutils
 
-import gi
-gi.require_version('PangoCairo', '1.0')
 from gi.repository import GLib, GObject, Pango, PangoCairo, Gdk, Gtk, Gedit
 
 from .signals import Signals
diff --git a/plugins/terminal/terminal.py b/plugins/terminal/terminal.py
index a9a4609..c177b9f 100644
--- a/plugins/terminal/terminal.py
+++ b/plugins/terminal/terminal.py
@@ -20,11 +20,15 @@
 # Foundation, Inc., 51 Franklin St, Fifth Floor,
 # Boston, MA  02110-1301  USA
 
+import os
+import gettext
+
 import gi
+gi.require_version('Gedit', '3.0')
+gi.require_version('Gtk', '3.0')
 gi.require_version('Vte', '2.91')
 from gi.repository import GObject, GLib, Gio, Pango, Gdk, Gtk, Gedit, Vte
-import os
-import gettext
+
 from gpdefs import *
 
 try:


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