summaryrefslogtreecommitdiff
path: root/plugins/externaltools/tools/__init__.py
diff options
context:
space:
mode:
authorPatrick Monnerat <[email protected]>2019-05-10 16:26:39 +0200
committerraveit65 <[email protected]>2019-05-21 09:36:44 +0200
commite88a2ea8adb4a57c9cf5c44fe30c210c8608361b (patch)
treea70133a625b31710d79dc5fdd77589b69e24c003 /plugins/externaltools/tools/__init__.py
parent676669e4e87130f639e118671d754a5e538f191c (diff)
downloadpluma-e88a2ea8adb4a57c9cf5c44fe30c210c8608361b.tar.bz2
pluma-e88a2ea8adb4a57c9cf5c44fe30c210c8608361b.tar.xz
Reindent all Python sources to ts=4. Strip trailing spaces.
Diffstat (limited to 'plugins/externaltools/tools/__init__.py')
-rwxr-xr-xplugins/externaltools/tools/__init__.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/plugins/externaltools/tools/__init__.py b/plugins/externaltools/tools/__init__.py
index 463c8f58..153d6c6e 100755
--- a/plugins/externaltools/tools/__init__.py
+++ b/plugins/externaltools/tools/__init__.py
@@ -57,12 +57,12 @@ class ToolMenu(object):
action._tool_handler = None
self._action_group.remove_action(action)
-
+
accelmap = Gtk.AccelMap.get()
for s in self._signals:
accelmap.disconnect(s)
-
+
self._signals = []
def _insert_directory(self, directory, path):
@@ -76,7 +76,7 @@ class ToolMenu(object):
manager.add_ui(self._merge_id, path,
action_name, action_name,
Gtk.UIManagerItemType.MENU, False)
-
+
self._insert_directory(item, path + '/' + action_name)
for item in directory.tools:
@@ -87,16 +87,16 @@ class ToolMenu(object):
# Attach the item and the handler to the action object
action._tool_item = item
action._tool_handler = handler
-
+
# Make sure to replace accel
accelpath = '<Actions>/ExternalToolsPluginToolActions/%s' % (action_name, )
-
+
if item.shortcut:
key, mod = Gtk.accelerator_parse(item.shortcut)
Gtk.AccelMap.change_entry(accelpath, key, mod, True)
-
+
self._signals.append(Gtk.AccelMap.get().connect('changed::%s' % (accelpath,), self.on_accelmap_changed, item))
-
+
self._action_group.add_action_with_accel(action, item.shortcut)
manager.add_ui(self._merge_id, path,
@@ -106,7 +106,7 @@ class ToolMenu(object):
def on_accelmap_changed(self, accelmap, path, key, mod, tool):
tool.shortcut = Gtk.accelerator_name(key, mod)
tool.save()
-
+
self._plugin.update_manager(tool)
def update(self):
@@ -119,10 +119,10 @@ class ToolMenu(object):
def filter_language(self, language, item):
if not item.languages:
return True
-
+
if not language and 'plain' in item.languages:
return True
-
+
if language and (language.get_id() in item.languages):
return True
else:
@@ -142,7 +142,7 @@ class ToolMenu(object):
'titled': titled,
'untitled': not titled,
}
-
+
language = document.get_language()
for action in self._action_group.list_actions():