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

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