Blame SOURCES/gedit-plugins-disable-python3.patch

cad95f
From 61a02d97f9f294537992a42f5f28432bd359caf1 Mon Sep 17 00:00:00 2001
cad95f
From: Ray Strode <rstrode@redhat.com>
cad95f
Date: Wed, 15 Mar 2017 15:04:47 -0400
cad95f
Subject: [PATCH] plugins: disable python 3
cad95f
cad95f
We only have python2 in rhel7
cad95f
---
cad95f
 configure.ac                                                  | 2 +-
cad95f
 .../bracketcompletion/bracketcompletion.plugin.desktop.in.in  | 2 +-
cad95f
 plugins/charmap/charmap.plugin.desktop.in.in                  | 2 +-
cad95f
 plugins/codecomment/codecomment.plugin.desktop.in.in          | 2 +-
cad95f
 plugins/colorpicker/colorpicker.plugin.desktop.in.in          | 2 +-
cad95f
 plugins/colorschemer/colorschemer.plugin.desktop.in.in        | 2 +-
cad95f
 plugins/commander/commander.plugin.desktop.in.in              | 2 +-
cad95f
 plugins/commander/commander/entry.py                          | 4 ++--
cad95f
 plugins/commander/commander/info.py                           | 4 ++--
cad95f
 plugins/dashboard/dashboard.plugin.desktop.in.in              | 2 +-
cad95f
 plugins/git/git/appactivatable.py                             | 2 +-
cad95f
 plugins/git/git/debug.py                                      | 2 +-
cad95f
 plugins/joinlines/joinlines.plugin.desktop.in.in              | 2 +-
cad95f
 plugins/multiedit/multiedit.plugin.desktop.in.in              | 2 +-
cad95f
 plugins/smartspaces/smartspaces.plugin.desktop.in.in          | 2 +-
cad95f
 plugins/synctex/synctex.plugin.desktop.in.in                  | 2 +-
cad95f
 plugins/terminal/terminal.plugin.desktop.in.in                | 2 +-
cad95f
 plugins/textsize/textsize.plugin.desktop.in.in                | 2 +-
cad95f
 plugins/translate/translate.plugin.desktop.in.in              | 2 +-
cad95f
 plugins/translate/translate/services/service.py               | 3 ++-
cad95f
 20 files changed, 23 insertions(+), 22 deletions(-)
cad95f
cad95f
diff --git a/configure.ac b/configure.ac
cad95f
index 870bd3a..3c071c4 100644
cad95f
--- a/configure.ac
cad95f
+++ b/configure.ac
cad95f
@@ -66,61 +66,61 @@ PKG_CHECK_MODULES(GEDIT, [
cad95f
 GLIB_GSETTINGS
cad95f
 
cad95f
 # C plugins that don't need special dependencies
cad95f
 C_PLUGINS="bookmarks drawspaces wordcompletion"
cad95f
 
cad95f
 # Python plugins that don't need special dependencies, besides Python
cad95f
 PY_PLUGINS="bracketcompletion codecomment colorpicker colorschemer commander joinlines multiedit smartspaces textsize translate"
cad95f
 
cad95f
 # Vala plugins that don't need special dependencies, besides Vala
cad95f
 VALA_PLUGINS="findinfiles"
cad95f
 
cad95f
 PLUGINS="$C_PLUGINS"
cad95f
 disabled_plugins=""
cad95f
 
cad95f
 # Check all plugins are built
cad95f
 AC_ARG_ENABLE([verify-all],
cad95f
               AC_HELP_STRING([--enable-verify-all], [verify that all plugins are enabled]),
cad95f
               [enable_verify_all=$enableval],
cad95f
               [enable_verify_all="no"])
cad95f
 
cad95f
 # Python
cad95f
 AC_MSG_CHECKING([whether Python support is requested])
cad95f
 AC_ARG_ENABLE([python],
cad95f
               AS_HELP_STRING([--enable-python], [Enable Python support]),
cad95f
               [enable_python=$enableval],
cad95f
               [enable_python=auto])
cad95f
 AC_MSG_RESULT([$enable_python])
cad95f
 
cad95f
 if test "x$enable_python" != "xno"
cad95f
 then
cad95f
-	AM_PATH_PYTHON(3, [have_python=yes], [have_python=no])
cad95f
+	AM_PATH_PYTHON(2, [have_python=yes], [have_python=no])
cad95f
 	if test "x$enable_python" = "xyes" -a "x$have_python" = "xno"; then
cad95f
 		AC_MSG_ERROR([Python support explicitly requested, but not found])
cad95f
 	fi
cad95f
 fi
cad95f
 
cad95f
 AM_CONDITIONAL([ENABLE_PYTHON], [test "x$have_python" = "xyes"])
cad95f
 
cad95f
 # Vala
cad95f
 AC_MSG_CHECKING([whether Vala support is requested])
cad95f
 AC_ARG_ENABLE([vala],
cad95f
               AS_HELP_STRING([--enable-vala], [Enable Vala support]),
cad95f
               [enable_vala=$enableval],
cad95f
               [enable_vala=auto])
cad95f
 AC_MSG_RESULT([$enable_vala])
cad95f
 
cad95f
 if test "x$enable_vala" != "xno"
cad95f
 then
cad95f
 	# This could probably be lower, but let's take the current version
cad95f
 	VALA_REQUIRED=0.28.0
cad95f
 	AM_PROG_VALAC([$VALA_REQS])
cad95f
 	if test "x$VALAC" = "x"; then
cad95f
 		if test "x$enable_vala" = "xyes"; then
cad95f
 			AC_MSG_ERROR([Vala support explicitly requested, but not found])
cad95f
 		fi
cad95f
 		have_vala=no
cad95f
 	else
cad95f
 		have_vala=yes
cad95f
 	fi
cad95f
 else
cad95f
 	have_vala=no
cad95f
diff --git a/plugins/bracketcompletion/bracketcompletion.plugin.desktop.in.in b/plugins/bracketcompletion/bracketcompletion.plugin.desktop.in.in
cad95f
index 71b32b6..0b1c05b 100644
cad95f
--- a/plugins/bracketcompletion/bracketcompletion.plugin.desktop.in.in
cad95f
+++ b/plugins/bracketcompletion/bracketcompletion.plugin.desktop.in.in
cad95f
@@ -1,10 +1,10 @@
cad95f
 [Plugin]
cad95f
-Loader=python3
cad95f
+Loader=python
cad95f
 Module=bracketcompletion
cad95f
 IAge=3
cad95f
 _Name=Bracket Completion
cad95f
 _Description=Automatically adds closing brackets.
cad95f
 Authors=Steve Frécinaux <steve@istique.net>
cad95f
 Copyright=Copyright @ 2006 Steve Frécinaux
cad95f
 Website=http://www.gedit.org
cad95f
 Version=@VERSION@
cad95f
diff --git a/plugins/charmap/charmap.plugin.desktop.in.in b/plugins/charmap/charmap.plugin.desktop.in.in
cad95f
index bb82259..719dc9f 100644
cad95f
--- a/plugins/charmap/charmap.plugin.desktop.in.in
cad95f
+++ b/plugins/charmap/charmap.plugin.desktop.in.in
cad95f
@@ -1,11 +1,11 @@
cad95f
 [Plugin]
cad95f
-Loader=python3
cad95f
+Loader=python
cad95f
 Module=charmap
cad95f
 IAge=3
cad95f
 _Name=Character Map
cad95f
 _Description=Insert special characters just by clicking on them.
cad95f
 Icon=accessories-character-map
cad95f
 Authors=Steve Frécinaux <steve@istique.net>;Ignacio Casal Quinteiro <icq@gnome.org>
cad95f
 Copyright=Copyright @ 2006 Steve Frécinaux
cad95f
 Website=http://www.gedit.org
cad95f
 Version=@VERSION@
cad95f
diff --git a/plugins/codecomment/codecomment.plugin.desktop.in.in b/plugins/codecomment/codecomment.plugin.desktop.in.in
cad95f
index 6561a2d..837fbee 100644
cad95f
--- a/plugins/codecomment/codecomment.plugin.desktop.in.in
cad95f
+++ b/plugins/codecomment/codecomment.plugin.desktop.in.in
cad95f
@@ -1,10 +1,10 @@
cad95f
 [Plugin]
cad95f
-Loader=python3
cad95f
+Loader=python
cad95f
 Module=codecomment
cad95f
 IAge=3
cad95f
 _Name=Code Comment
cad95f
 _Description=Comment out or uncomment a selected block of code.
cad95f
 Authors=Alejandro Garcia <alex@igalia.com>;Matthew Dugan <matthew.dugan@gmail.com>
cad95f
 Copyright=Copyright @ 2005-2006 Igalia, S.L.;Copyright @ 2006 Matthew Dugan
cad95f
 Website=http://www.gedit.org
cad95f
 Version=@VERSION@
cad95f
diff --git a/plugins/colorpicker/colorpicker.plugin.desktop.in.in b/plugins/colorpicker/colorpicker.plugin.desktop.in.in
cad95f
index c02867e..1cc2c1e 100644
cad95f
--- a/plugins/colorpicker/colorpicker.plugin.desktop.in.in
cad95f
+++ b/plugins/colorpicker/colorpicker.plugin.desktop.in.in
cad95f
@@ -1,10 +1,10 @@
cad95f
 [Plugin]
cad95f
-Loader=python3
cad95f
+Loader=python
cad95f
 Module=colorpicker
cad95f
 IAge=3
cad95f
 _Name=Color Picker
cad95f
 _Description=Pick a color from a dialog and insert its hexadecimal representation.
cad95f
 Authors=Jesse van den Kieboom <jesse@icecrew.nl>;Ignacio Casal Quinteiro <icq@gnome.org>
cad95f
 Copyright=Copyright © 2006 Jesse van den Kieboom;Copyright © 2012 Ignacio Casal Quinteiro
cad95f
 Website=http://www.gedit.org
cad95f
 Version=@VERSION@
cad95f
diff --git a/plugins/colorschemer/colorschemer.plugin.desktop.in.in b/plugins/colorschemer/colorschemer.plugin.desktop.in.in
cad95f
index 2d2b1f0..f9d30f3 100644
cad95f
--- a/plugins/colorschemer/colorschemer.plugin.desktop.in.in
cad95f
+++ b/plugins/colorschemer/colorschemer.plugin.desktop.in.in
cad95f
@@ -1,10 +1,10 @@
cad95f
 [Plugin]
cad95f
-Loader=python3
cad95f
+Loader=python
cad95f
 Module=colorschemer
cad95f
 IAge=3
cad95f
 _Name=Color Scheme Editor
cad95f
 _Description=Source code color scheme editor
cad95f
 Authors=Jono <jono@foodnotblogs.com>
cad95f
 Copyright=Copyright © 2013 Jono Finger
cad95f
 Website=https://github.com/jonocodes/GeditSchemer
cad95f
 Version=@VERSION@
cad95f
diff --git a/plugins/commander/commander.plugin.desktop.in.in b/plugins/commander/commander.plugin.desktop.in.in
cad95f
index 0f0cb01..05cbe14 100644
cad95f
--- a/plugins/commander/commander.plugin.desktop.in.in
cad95f
+++ b/plugins/commander/commander.plugin.desktop.in.in
cad95f
@@ -1,10 +1,10 @@
cad95f
 [Plugin]
cad95f
-Loader=python3
cad95f
+Loader=python
cad95f
 Module=commander
cad95f
 IAge=3
cad95f
 _Name=Commander
cad95f
 _Description=Command line interface for advanced editing
cad95f
 Authors=Jesse van den Kieboom <jessevdk@gnome.org>
cad95f
 Copyright=Copyright © 2009 Jesse van den Kieboom
cad95f
 Website=http://www.gedit.org
cad95f
 Version=@VERSION@
cad95f
diff --git a/plugins/commander/commander/entry.py b/plugins/commander/commander/entry.py
cad95f
index 0a376b3..85bd1af 100644
cad95f
--- a/plugins/commander/commander/entry.py
cad95f
+++ b/plugins/commander/commander/entry.py
cad95f
@@ -66,82 +66,82 @@ class Entry(Gtk.Box):
cad95f
         self._cancel_button = None
cad95f
         self._info = None
cad95f
         self._info_revealer = None
cad95f
 
cad95f
         self._suspended = None
cad95f
 
cad95f
         self._handlers = [
cad95f
             [0, Gdk.KEY_Up, self._on_history_move, -1],
cad95f
             [0, Gdk.KEY_Down, self._on_history_move, 1],
cad95f
             [None, Gdk.KEY_Return, self._on_execute, None],
cad95f
             [None, Gdk.KEY_KP_Enter, self._on_execute, None],
cad95f
             [0, Gdk.KEY_Tab, self._on_complete, None],
cad95f
             [0, Gdk.KEY_ISO_Left_Tab, self._on_complete, None]
cad95f
         ]
cad95f
 
cad95f
         self._re_complete = re.compile('("((?:\\\\"|[^"])*)"?|\'((?:\\\\\'|[^\'])*)\'?|[^\s]+)')
cad95f
         self._command_state = commands.Commands.State()
cad95f
 
cad95f
         self.connect('destroy', self._on_destroy)
cad95f
 
cad95f
         self._build_ui()
cad95f
         self._setup_keybindings()
cad95f
 
cad95f
         self._attach()
cad95f
 
cad95f
     def view(self):
cad95f
         return self._view
cad95f
 
cad95f
     def _setup_keybindings(self):
cad95f
         css = Gtk.CssProvider()
cad95f
-        css.load_from_data(bytes("""
cad95f
+        css.load_from_data("""
cad95f
 @binding-set terminal-like-bindings {
cad95f
     unbind "<Control>A";
cad95f
 
cad95f
     bind "<Control>W" { "delete-from-cursor" (word-ends, -1) };
cad95f
     bind "<Control>A" { "move-cursor" (buffer-ends, -1, 0) };
cad95f
     bind "<Control>U" { "delete-from-cursor" (display-line-ends, -1) };
cad95f
     bind "<Control>K" { "delete-from-cursor" (display-line-ends, 1) };
cad95f
     bind "<Control>E" { "move-cursor" (buffer-ends, 1, 0) };
cad95f
     bind "Escape" { "delete-from-cursor" (display-lines, 1) };
cad95f
 }
cad95f
 
cad95f
 GtkEntry#gedit-commander-entry {
cad95f
     gtk-key-bindings: terminal-like-bindings;
cad95f
 
cad95f
     background-image: none;
cad95f
     box-shadow: 0 0;
cad95f
     transition: none;
cad95f
     border: 0;
cad95f
 }
cad95f
 
cad95f
-""", 'utf-8'))
cad95f
+""")
cad95f
 
cad95f
         self._entry.get_style_context().add_provider(css, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
cad95f
 
cad95f
     def _find_overlay(self, view):
cad95f
         parent = view.get_parent()
cad95f
 
cad95f
         while not isinstance(parent, Gtk.Overlay):
cad95f
             parent = parent.get_parent()
cad95f
 
cad95f
         return parent
cad95f
 
cad95f
     def _build_ui(self):
cad95f
         self.set_orientation(Gtk.Orientation.VERTICAL)
cad95f
 
cad95f
         self._overlay = self._find_overlay(self._view)
cad95f
 
cad95f
         hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6)
cad95f
         hbox.show()
cad95f
 
cad95f
         self.pack_end(hbox, False, False, 0)
cad95f
 
cad95f
         self._info_revealer = Gtk.Revealer()
cad95f
 
cad95f
         self._info_revealer.set_transition_type(Gtk.RevealerTransitionType.SLIDE_UP)
cad95f
         self._info_revealer.set_transition_duration(150)
cad95f
 
cad95f
         self.pack_start(self._info_revealer, False, False, 0)
cad95f
         self._info_revealer.connect('notify::child-revealed', self._on_info_revealer_child_revealed)
cad95f
 
cad95f
         self._prompt_label = Gtk.Label(label='>>>', use_markup=True)
cad95f
diff --git a/plugins/commander/commander/info.py b/plugins/commander/commander/info.py
cad95f
index a18c240..7f96f1f 100644
cad95f
--- a/plugins/commander/commander/info.py
cad95f
+++ b/plugins/commander/commander/info.py
cad95f
@@ -66,65 +66,65 @@ class ScrolledWindow(Gtk.ScrolledWindow):
cad95f
 
cad95f
         if vp == Gtk.PolicyType.NEVER and ret[0] > self._max_height:
cad95f
             self.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.ALWAYS)
cad95f
             self.set_min_content_height(self._max_height)
cad95f
         elif vp == Gtk.PolicyType.ALWAYS and ret[0] < self._max_height:
cad95f
             self.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.NEVER)
cad95f
             self.set_min_content_height(0)
cad95f
 
cad95f
         return Gtk.ScrolledWindow.do_get_preferred_height(self)
cad95f
 
cad95f
 class Info(Gtk.Box):
cad95f
     __gtype_name__ = "CommanderInfo"
cad95f
 
cad95f
     def __init__(self):
cad95f
         super(Info, self).__init__()
cad95f
 
cad95f
         self._button_bar = None
cad95f
         self._status_label = None
cad95f
 
cad95f
         self._build_ui()
cad95f
 
cad95f
     def _build_ui(self):
cad95f
         self.set_orientation(Gtk.Orientation.VERTICAL)
cad95f
         self.set_spacing(3)
cad95f
         self.set_can_focus(False)
cad95f
 
cad95f
         self._sw = ScrolledWindow()
cad95f
         self._sw.set_border_width(6)
cad95f
 
cad95f
         css = Gtk.CssProvider()
cad95f
-        css.load_from_data(bytes("""
cad95f
+        css.load_from_data("""
cad95f
 .trough {
cad95f
     background: transparent;
cad95f
 }
cad95f
-""", 'utf-8'))
cad95f
+""")
cad95f
 
cad95f
         self._sw.get_vscrollbar().get_style_context().add_provider(css, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
cad95f
 
cad95f
         self._sw.show()
cad95f
         self.add(self._sw)
cad95f
 
cad95f
         self._attr_map = {
cad95f
             Pango.AttrType.STYLE: ('style', Pango.AttrInt),
cad95f
             Pango.AttrType.WEIGHT: ('weight', Pango.AttrInt),
cad95f
             Pango.AttrType.VARIANT: ('variant', Pango.AttrInt),
cad95f
             Pango.AttrType.STRETCH: ('stretch', Pango.AttrInt),
cad95f
             Pango.AttrType.SIZE: ('size', Pango.AttrInt),
cad95f
             Pango.AttrType.FOREGROUND: ('foreground', Pango.AttrColor),
cad95f
             Pango.AttrType.BACKGROUND: ('background', Pango.AttrColor),
cad95f
             Pango.AttrType.UNDERLINE: ('underline', Pango.AttrInt),
cad95f
             Pango.AttrType.STRIKETHROUGH: ('strikethrough', Pango.AttrInt),
cad95f
             Pango.AttrType.RISE: ('rise', Pango.AttrInt),
cad95f
             Pango.AttrType.SCALE: ('scale', Pango.AttrFloat)
cad95f
         }
cad95f
 
cad95f
     @property
cad95f
     def text_view(self):
cad95f
         return self._sw.view
cad95f
 
cad95f
     @property
cad95f
     def is_empty(self):
cad95f
         buf = self.text_view.get_buffer()
cad95f
         return buf.get_start_iter().equal(buf.get_end_iter())
cad95f
 
cad95f
     def status(self, text=None):
cad95f
diff --git a/plugins/dashboard/dashboard.plugin.desktop.in.in b/plugins/dashboard/dashboard.plugin.desktop.in.in
cad95f
index 2e74944..8150515 100644
cad95f
--- a/plugins/dashboard/dashboard.plugin.desktop.in.in
cad95f
+++ b/plugins/dashboard/dashboard.plugin.desktop.in.in
cad95f
@@ -1,10 +1,10 @@
cad95f
 [Plugin]
cad95f
-Loader=python3
cad95f
+Loader=python
cad95f
 Module=dashboard
cad95f
 IAge=3
cad95f
 _Name=Dashboard
cad95f
 _Description=A Dashboard for new tabs
cad95f
 Authors=Seif Lotfy <seif@lotfy.com>
cad95f
 Copyright=Copyright © 2011 Collabora Ltd.
cad95f
 Website=http://www.gedit.org
cad95f
 Version=@VERSION@
cad95f
diff --git a/plugins/git/git/appactivatable.py b/plugins/git/git/appactivatable.py
cad95f
index d746c21..f8d978e 100644
cad95f
--- a/plugins/git/git/appactivatable.py
cad95f
+++ b/plugins/git/git/appactivatable.py
cad95f
@@ -20,61 +20,61 @@
cad95f
 from gi.repository import GLib, GObject, Gio, Gedit, Ggit
cad95f
 
cad95f
 
cad95f
 class GitAppActivatable(GObject.Object, Gedit.AppActivatable):
cad95f
     app = GObject.Property(type=Gedit.App)
cad95f
 
cad95f
     __instance = None
cad95f
 
cad95f
     def __init__(self):
cad95f
         super().__init__()
cad95f
 
cad95f
         Ggit.init()
cad95f
 
cad95f
         GitAppActivatable.__instance = self
cad95f
 
cad95f
     def do_activate(self):
cad95f
         self.clear_repositories()
cad95f
 
cad95f
     def do_deactivate(self):
cad95f
         self.__git_repos = None
cad95f
         self.__workdir_repos = None
cad95f
 
cad95f
     @classmethod
cad95f
     def get_instance(cls):
cad95f
         return cls.__instance
cad95f
 
cad95f
     def clear_repositories(self):
cad95f
         self.__git_repos = {}
cad95f
         self.__workdir_repos = {}
cad95f
 
cad95f
-    def get_repository(self, location, is_dir, *, allow_git_dir=False):
cad95f
+    def get_repository(self, location, is_dir, allow_git_dir=False):
cad95f
         # The repos are cached by the directory
cad95f
         dir_location = location if is_dir else location.get_parent()
cad95f
         dir_uri = dir_location.get_uri()
cad95f
 
cad95f
         # Fast Path
cad95f
         try:
cad95f
             return self.__workdir_repos[dir_uri]
cad95f
 
cad95f
         except KeyError:
cad95f
             pass
cad95f
 
cad95f
         try:
cad95f
             repo = self.__git_repos[dir_uri]
cad95f
 
cad95f
         except KeyError:
cad95f
             pass
cad95f
 
cad95f
         else:
cad95f
             return repo if allow_git_dir else None
cad95f
 
cad95f
         # Doing remote operations is too slow
cad95f
         if not location.has_uri_scheme('file'):
cad95f
             return None
cad95f
 
cad95f
         # Must check every dir, otherwise submodules will have issues
cad95f
         try:
cad95f
             repo_file = Ggit.Repository.discover(location)
cad95f
 
cad95f
         except GLib.Error:
cad95f
             # Prevent trying to find a git repository
cad95f
diff --git a/plugins/git/git/debug.py b/plugins/git/git/debug.py
cad95f
index d608574..a661ab5 100644
cad95f
--- a/plugins/git/git/debug.py
cad95f
+++ b/plugins/git/git/debug.py
cad95f
@@ -1,60 +1,60 @@
cad95f
 # -*- coding: utf-8 -*-
cad95f
  
cad95f
 #  Copyright (C) 2014 - Garrett Regier
cad95f
 #
cad95f
 #  This program is free software; you can redistribute it and/or modify
cad95f
 #  it under the terms of the GNU General Public License as published by
cad95f
 #  the Free Software Foundation; either version 2 of the License, or
cad95f
 #  (at your option) any later version.
cad95f
 #
cad95f
 #  This program is distributed in the hope that it will be useful,
cad95f
 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
cad95f
 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
cad95f
 #  GNU General Public License for more details.
cad95f
 #
cad95f
 #  You should have received a copy of the GNU General Public License
cad95f
 #  along with this program; if not, write to the Free Software
cad95f
 #  Foundation, Inc.  51 Franklin Street, Fifth Floor, Boston, MA
cad95f
 #  02110-1301 USA.
cad95f
  
cad95f
 import inspect
cad95f
 import io
cad95f
 import os
cad95f
 import sys
cad95f
 import traceback
cad95f
  
cad95f
  
cad95f
 _DEBUG = os.getenv('GEDIT_DEBUG_GIT_PLUGIN') is not None
cad95f
  
cad95f
  
cad95f
-def debug(msg, *, frames=1, print_stack=False, limit=None):
cad95f
+def debug(msg, frames=1, print_stack=False, limit=None):
cad95f
     """Mimicks Gedit's gedit_debug_message() output, but only prints
cad95f
        when the GEDIT_DEBUG_GIT_PLUGIN enviroment variable exists.
cad95f
     """
cad95f
     if not _DEBUG:
cad95f
         return
cad95f
  
cad95f
     current_frame = inspect.currentframe()
cad95f
     calling_frame = current_frame
cad95f
  
cad95f
     try:
cad95f
         for i in range(frames):
cad95f
             calling_frame = calling_frame.f_back
cad95f
  
cad95f
         info = inspect.getframeinfo(calling_frame)
cad95f
  
cad95f
         path = min(info.filename.replace(x, '') for x in sys.path)
cad95f
         if path[0] == os.path.sep:
cad95f
             path = path[1:]
cad95f
  
cad95f
         full_message = io.StringIO()
cad95f
         full_message.writelines((path, ':', str(info.lineno),
cad95f
                                  ' (', info.function, ') ', msg, '\n'))
cad95f
  
cad95f
         if print_stack:
cad95f
             full_message.write('Stack (most recent call last):\n')
cad95f
             traceback.print_stack(calling_frame,
cad95f
                                   file=full_message, limit=limit)
cad95f
  
cad95f
         if full_message.getvalue()[-1] != '\n':
cad95f
             full_message.write('\n')
cad95f
diff --git a/plugins/joinlines/joinlines.plugin.desktop.in.in b/plugins/joinlines/joinlines.plugin.desktop.in.in
cad95f
index 5ea1a42..b76bd63 100644
cad95f
--- a/plugins/joinlines/joinlines.plugin.desktop.in.in
cad95f
+++ b/plugins/joinlines/joinlines.plugin.desktop.in.in
cad95f
@@ -1,10 +1,10 @@
cad95f
 [Plugin]
cad95f
-Loader=python3
cad95f
+Loader=python
cad95f
 Module=joinlines
cad95f
 IAge=3
cad95f
 _Name=Join/Split Lines
cad95f
 _Description=Join several lines or split long ones
cad95f
 Authors=Steve Frécinaux <steve@istique.net>;André Homeyer
cad95f
 Copyright=Copyright @ 2006-2007 Steve Frécinaux, André Homeyer
cad95f
 Website=http://www.gedit.org
cad95f
 Version=@VERSION@
cad95f
diff --git a/plugins/multiedit/multiedit.plugin.desktop.in.in b/plugins/multiedit/multiedit.plugin.desktop.in.in
cad95f
index 7b7b137..6f315ef 100644
cad95f
--- a/plugins/multiedit/multiedit.plugin.desktop.in.in
cad95f
+++ b/plugins/multiedit/multiedit.plugin.desktop.in.in
cad95f
@@ -1,10 +1,10 @@
cad95f
 [Plugin]
cad95f
-Loader=python3
cad95f
+Loader=python
cad95f
 Module=multiedit
cad95f
 IAge=3
cad95f
 _Name=Multi Edit
cad95f
 _Description=Edit document in multiple places at once
cad95f
 Authors=Jesse van den Kieboom <jessevdk@gnome.org>
cad95f
 Copyright=Copyright © 2009 Jesse van den Kieboom
cad95f
 Website=http://www.gedit.org
cad95f
 Version=@VERSION@
cad95f
diff --git a/plugins/smartspaces/smartspaces.plugin.desktop.in.in b/plugins/smartspaces/smartspaces.plugin.desktop.in.in
cad95f
index f9ca79a..9671fe3 100644
cad95f
--- a/plugins/smartspaces/smartspaces.plugin.desktop.in.in
cad95f
+++ b/plugins/smartspaces/smartspaces.plugin.desktop.in.in
cad95f
@@ -1,10 +1,10 @@
cad95f
 [Plugin]
cad95f
-Loader=python3
cad95f
+Loader=python
cad95f
 Module=smartspaces
cad95f
 IAge=3
cad95f
 _Name=Smart Spaces
cad95f
 _Description=Forget you’re not using tabulations.
cad95f
 Authors=Steve Frécinaux <steve@istique.net>
cad95f
 Copyright=Copyright © 2006 Steve Frécinaux
cad95f
 Website=http://www.gedit.org
cad95f
 Version=@VERSION@
cad95f
diff --git a/plugins/synctex/synctex.plugin.desktop.in.in b/plugins/synctex/synctex.plugin.desktop.in.in
cad95f
index b465129..1bb8da1 100644
cad95f
--- a/plugins/synctex/synctex.plugin.desktop.in.in
cad95f
+++ b/plugins/synctex/synctex.plugin.desktop.in.in
cad95f
@@ -1,10 +1,10 @@
cad95f
 [Plugin]
cad95f
-Loader=python3
cad95f
+Loader=python
cad95f
 Module=synctex
cad95f
 IAge=3
cad95f
 _Name=SyncTeX
cad95f
 _Description=Synchronize between LaTeX and PDF with gedit and evince.
cad95f
 Authors=José Aliste <jaliste@src.gnome.org>
cad95f
 Copyright=Copyright © 2010 José Aliste
cad95f
 Website=http://www.gedit.org
cad95f
 Version=@VERSION@
cad95f
diff --git a/plugins/terminal/terminal.plugin.desktop.in.in b/plugins/terminal/terminal.plugin.desktop.in.in
cad95f
index dac9ac1..fcbe266 100644
cad95f
--- a/plugins/terminal/terminal.plugin.desktop.in.in
cad95f
+++ b/plugins/terminal/terminal.plugin.desktop.in.in
cad95f
@@ -1,11 +1,11 @@
cad95f
 [Plugin]
cad95f
-Loader=python3
cad95f
+Loader=python
cad95f
 Module=terminal
cad95f
 IAge=3
cad95f
 _Name=Embedded Terminal
cad95f
 _Description=Embed a terminal in the bottom pane.
cad95f
 Icon=utilities-terminal
cad95f
 Authors=Paolo Borelli
cad95f
 Copyright=Copyright © 2005 Paolo Borelli
cad95f
 Website=http://www.gedit.org
cad95f
 Version=@VERSION@
cad95f
diff --git a/plugins/textsize/textsize.plugin.desktop.in.in b/plugins/textsize/textsize.plugin.desktop.in.in
cad95f
index 8c12009..c4cecea 100644
cad95f
--- a/plugins/textsize/textsize.plugin.desktop.in.in
cad95f
+++ b/plugins/textsize/textsize.plugin.desktop.in.in
cad95f
@@ -1,10 +1,10 @@
cad95f
 [Plugin]
cad95f
-Loader=python3
cad95f
+Loader=python
cad95f
 Module=textsize
cad95f
 IAge=3
cad95f
 _Name=Text Size
cad95f
 _Description=Easily increase and decrease the text size
cad95f
 Authors=Konstantin Mikhaylov <jtraub.devel@gmail.com>;Wouter Bolsterlee <wbolster@gnome.org>;Jesse van den Kieboom <jessevdk@gnome.org>
cad95f
 Copyright=Copyright © 2008 by the authors
cad95f
 Website=http://www.gedit.org
cad95f
 Version=@VERSION@
cad95f
diff --git a/plugins/translate/translate.plugin.desktop.in.in b/plugins/translate/translate.plugin.desktop.in.in
cad95f
index 76ecfb7..4e75739 100644
cad95f
--- a/plugins/translate/translate.plugin.desktop.in.in
cad95f
+++ b/plugins/translate/translate.plugin.desktop.in.in
cad95f
@@ -1,10 +1,10 @@
cad95f
 [Plugin]
cad95f
-Loader=python3
cad95f
+Loader=python
cad95f
 Module=translate
cad95f
 IAge=3
cad95f
 _Name=Translate
cad95f
 _Description=Translates text into different languages
cad95f
 Authors=Jordi Mas i Hernàndez <jmas@softcatala.org>
cad95f
 Copyright=Copyright @ 2017 Jordi Mas i Hernàndez. Powered by Apertium and Yandex.Translate translation engines. 
cad95f
 Website=http://www.gedit.org
cad95f
 Version=@VERSION@
cad95f
diff --git a/plugins/translate/translate/services/service.py b/plugins/translate/translate/services/service.py
cad95f
index 5406c6e..05a4182 100644
cad95f
--- a/plugins/translate/translate/services/service.py
cad95f
+++ b/plugins/translate/translate/services/service.py
cad95f
@@ -1,52 +1,53 @@
cad95f
 # -*- coding: utf-8 -*-
cad95f
 #
cad95f
 #  Copyrignt (C) 2017 Jordi Mas <jmas@softcatala.org>
cad95f
 #
cad95f
 #  This program is free software; you can redistribute it and/or modify
cad95f
 #  it under the terms of the GNU General Public License as published by
cad95f
 #  the Free Software Foundation; either version 2 of the License, or
cad95f
 #  (at your option) any later version.
cad95f
 #
cad95f
 #  This program is distributed in the hope that it will be useful,
cad95f
 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
cad95f
 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
cad95f
 #  GNU General Public License for more details.
cad95f
 #
cad95f
 #  You should have received a copy of the GNU General Public License
cad95f
 #  along with this program; if not, write to the Free Software
cad95f
 #  Foundation, Inc., 51 Franklin Street, Fifth Floor,
cad95f
 #  Boston, MA 02110-1301, USA.
cad95f
 
cad95f
 from abc import ABCMeta, abstractmethod
cad95f
 
cad95f
-class Service(metaclass=ABCMeta):
cad95f
+class Service:
cad95f
+    __metaclass__ = ABCMeta
cad95f
 
cad95f
     @abstractmethod
cad95f
     def translate_text(self, text, language_pair):
cad95f
         pass
cad95f
 
cad95f
     @abstractmethod
cad95f
     def get_language_names(self):
cad95f
         pass
cad95f
 
cad95f
     @abstractmethod
cad95f
     def get_language_codes(self):
cad95f
         pass
cad95f
 
cad95f
     @abstractmethod
cad95f
     def get_language_pair_name(self, source, target, locales_names=None):
cad95f
         pass
cad95f
 
cad95f
     @abstractmethod
cad95f
     def get_default_language_codes(self):
cad95f
         pass
cad95f
 
cad95f
     @abstractmethod
cad95f
     def has_api_key(self):
cad95f
         pass
cad95f
 
cad95f
     @abstractmethod
cad95f
     def get_api_hint(self):
cad95f
         pass
cad95f
     
cad95f
     @abstractmethod    
cad95f
-- 
cad95f
2.17.1
cad95f