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