renaming from gedit to pluma
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Python snippets plugin
|
||||
|
||||
plugindir = $(GEDIT_PLUGINS_LIBS_DIR)/externaltools
|
||||
plugindir = $(PLUMA_PLUGINS_LIBS_DIR)/externaltools
|
||||
plugin_PYTHON = \
|
||||
__init__.py \
|
||||
capture.py \
|
||||
@@ -11,7 +11,7 @@ plugin_PYTHON = \
|
||||
filelookup.py \
|
||||
linkparsing.py
|
||||
|
||||
uidir = $(GEDIT_PLUGINS_DATA_DIR)/externaltools/ui
|
||||
uidir = $(PLUMA_PLUGINS_DATA_DIR)/externaltools/ui
|
||||
ui_DATA = tools.ui \
|
||||
outputpanel.ui
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# -*- coding: UTF-8 -*-
|
||||
# Gedit External Tools plugin
|
||||
# Pluma External Tools plugin
|
||||
# Copyright (C) 2005-2006 Steve Frécinaux <steve@istique.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -19,7 +19,7 @@
|
||||
__all__ = ('ExternalToolsPlugin', 'ExternalToolsWindowHelper',
|
||||
'Manager', 'OutputPanel', 'Capture', 'UniqueById')
|
||||
|
||||
import gedit
|
||||
import pluma
|
||||
import gtk
|
||||
from manager import Manager
|
||||
from library import ToolLibrary
|
||||
@@ -166,7 +166,7 @@ class ExternalToolsWindowHelper(object):
|
||||
manager = window.get_ui_manager()
|
||||
|
||||
self._action_group = gtk.ActionGroup('ExternalToolsPluginActions')
|
||||
self._action_group.set_translation_domain('gedit')
|
||||
self._action_group.set_translation_domain('pluma')
|
||||
self._action_group.add_actions([('ExternalToolManager',
|
||||
None,
|
||||
_('Manage _External Tools...'),
|
||||
@@ -229,7 +229,7 @@ class ExternalToolsWindowHelper(object):
|
||||
def update_manager(self, tool):
|
||||
self._plugin.update_manager(tool)
|
||||
|
||||
class ExternalToolsPlugin(gedit.Plugin):
|
||||
class ExternalToolsPlugin(pluma.Plugin):
|
||||
WINDOW_DATA_KEY = "ExternalToolsPluginWindowData"
|
||||
|
||||
def __init__(self):
|
||||
@@ -263,7 +263,7 @@ class ExternalToolsPlugin(gedit.Plugin):
|
||||
|
||||
self._manager.dialog.connect('destroy', self.on_manager_destroy)
|
||||
|
||||
window = gedit.app_get_default().get_active_window()
|
||||
window = pluma.app_get_default().get_active_window()
|
||||
self._manager.run(window)
|
||||
|
||||
return self._manager.dialog
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Gedit External Tools plugin
|
||||
# Pluma External Tools plugin
|
||||
# Copyright (C) 2005-2006 Steve Frécinaux <steve@istique.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
|
@@ -18,7 +18,7 @@
|
||||
|
||||
import os
|
||||
import gio
|
||||
import gedit
|
||||
import pluma
|
||||
|
||||
class FileLookup:
|
||||
"""
|
||||
@@ -110,7 +110,7 @@ class OpenDocumentRelPathFileLookupProvider(FileLookupProvider):
|
||||
if path.startswith('/'):
|
||||
return None
|
||||
|
||||
for doc in gedit.app_get_default().get_documents():
|
||||
for doc in pluma.app_get_default().get_documents():
|
||||
if doc.is_local():
|
||||
location = doc.get_location()
|
||||
if location:
|
||||
@@ -135,7 +135,7 @@ class OpenDocumentFileLookupProvider(FileLookupProvider):
|
||||
if path.startswith('/'):
|
||||
return None
|
||||
|
||||
for doc in gedit.app_get_default().get_documents():
|
||||
for doc in pluma.app_get_default().get_documents():
|
||||
if doc.is_local():
|
||||
location = doc.get_location()
|
||||
if location and location.get_uri().endswith(path):
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Gedit External Tools plugin
|
||||
# Pluma External Tools plugin
|
||||
# Copyright (C) 2005-2006 Steve Frécinaux <steve@istique.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -20,7 +20,7 @@ import os
|
||||
import gtk
|
||||
from gtk import gdk
|
||||
import gio
|
||||
import gedit
|
||||
import pluma
|
||||
#import gtksourceview
|
||||
from outputpanel import OutputPanel
|
||||
from capture import *
|
||||
@@ -53,7 +53,7 @@ def run_external_tool(window, node):
|
||||
|
||||
capture = Capture(node.command, cwd)
|
||||
capture.env = os.environ.copy()
|
||||
capture.set_env(GEDIT_CWD = cwd)
|
||||
capture.set_env(PLUMA_CWD = cwd)
|
||||
|
||||
view = window.get_active_view()
|
||||
if view is not None:
|
||||
@@ -63,7 +63,7 @@ def run_external_tool(window, node):
|
||||
|
||||
# Current line number
|
||||
piter = document.get_iter_at_mark(document.get_insert())
|
||||
capture.set_env(GEDIT_CURRENT_LINE_NUMBER=str(piter.get_line() + 1))
|
||||
capture.set_env(PLUMA_CURRENT_LINE_NUMBER=str(piter.get_line() + 1))
|
||||
|
||||
# Current line text
|
||||
piter.set_line_offset(0)
|
||||
@@ -72,42 +72,42 @@ def run_external_tool(window, node):
|
||||
if not end.ends_line():
|
||||
end.forward_to_line_end()
|
||||
|
||||
capture.set_env(GEDIT_CURRENT_LINE=piter.get_text(end))
|
||||
capture.set_env(PLUMA_CURRENT_LINE=piter.get_text(end))
|
||||
|
||||
# Selected text (only if input is not selection)
|
||||
if node.input != 'selection' and node.input != 'selection-document':
|
||||
bounds = document.get_selection_bounds()
|
||||
|
||||
if bounds:
|
||||
capture.set_env(GEDIT_SELECTED_TEXT=bounds[0].get_text(bounds[1]))
|
||||
capture.set_env(PLUMA_SELECTED_TEXT=bounds[0].get_text(bounds[1]))
|
||||
|
||||
bounds = current_word(document)
|
||||
capture.set_env(GEDIT_CURRENT_WORD=bounds[0].get_text(bounds[1]))
|
||||
capture.set_env(PLUMA_CURRENT_WORD=bounds[0].get_text(bounds[1]))
|
||||
|
||||
capture.set_env(GEDIT_CURRENT_DOCUMENT_TYPE=document.get_mime_type())
|
||||
capture.set_env(PLUMA_CURRENT_DOCUMENT_TYPE=document.get_mime_type())
|
||||
|
||||
if uri is not None:
|
||||
gfile = gio.File(uri)
|
||||
scheme = gfile.get_uri_scheme()
|
||||
name = os.path.basename(uri)
|
||||
capture.set_env(GEDIT_CURRENT_DOCUMENT_URI = uri,
|
||||
GEDIT_CURRENT_DOCUMENT_NAME = name,
|
||||
GEDIT_CURRENT_DOCUMENT_SCHEME = scheme)
|
||||
if gedit.utils.uri_has_file_scheme(uri):
|
||||
capture.set_env(PLUMA_CURRENT_DOCUMENT_URI = uri,
|
||||
PLUMA_CURRENT_DOCUMENT_NAME = name,
|
||||
PLUMA_CURRENT_DOCUMENT_SCHEME = scheme)
|
||||
if pluma.utils.uri_has_file_scheme(uri):
|
||||
path = gfile.get_path()
|
||||
cwd = os.path.dirname(path)
|
||||
capture.set_cwd(cwd)
|
||||
capture.set_env(GEDIT_CURRENT_DOCUMENT_PATH = path,
|
||||
GEDIT_CURRENT_DOCUMENT_DIR = cwd)
|
||||
capture.set_env(PLUMA_CURRENT_DOCUMENT_PATH = path,
|
||||
PLUMA_CURRENT_DOCUMENT_DIR = cwd)
|
||||
|
||||
documents_uri = [doc.get_uri()
|
||||
for doc in window.get_documents()
|
||||
if doc.get_uri() is not None]
|
||||
documents_path = [gio.File(uri).get_path()
|
||||
for uri in documents_uri
|
||||
if gedit.utils.uri_has_file_scheme(uri)]
|
||||
capture.set_env(GEDIT_DOCUMENTS_URI = ' '.join(documents_uri),
|
||||
GEDIT_DOCUMENTS_PATH = ' '.join(documents_path))
|
||||
if pluma.utils.uri_has_file_scheme(uri)]
|
||||
capture.set_env(PLUMA_DOCUMENTS_URI = ' '.join(documents_uri),
|
||||
PLUMA_DOCUMENTS_PATH = ' '.join(documents_path))
|
||||
|
||||
flags = capture.CAPTURE_BOTH
|
||||
|
||||
@@ -224,7 +224,7 @@ class MultipleDocumentsSaver:
|
||||
|
||||
for doc in docs:
|
||||
signals[doc] = doc.connect('saving', self.on_document_saving)
|
||||
gedit.commands.save_document(window, doc)
|
||||
pluma.commands.save_document(window, doc)
|
||||
doc.disconnect(signals[doc])
|
||||
|
||||
def on_document_saving(self, doc, size, total_size):
|
||||
@@ -277,7 +277,7 @@ def capture_end_execute_panel(capture, exit_code, panel, view, output_type):
|
||||
end.forward_chars(300)
|
||||
|
||||
mtype = gio.content_type_guess(data=doc.get_text(start, end))
|
||||
lmanager = gedit.get_language_manager()
|
||||
lmanager = pluma.get_language_manager()
|
||||
|
||||
language = lmanager.guess_language(doc.get_uri(), mtype)
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Gedit External Tools plugin
|
||||
# Pluma External Tools plugin
|
||||
# Copyright (C) 2006 Steve Frécinaux <code@istique.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -41,19 +41,19 @@ class ToolLibrary(Singleton):
|
||||
|
||||
if platform.platform() != 'Windows':
|
||||
for d in self.get_xdg_data_dirs():
|
||||
self.locations.append(os.path.join(d, 'gedit-2', 'plugins', 'externaltools', 'tools'))
|
||||
self.locations.append(os.path.join(d, 'pluma-2', 'plugins', 'externaltools', 'tools'))
|
||||
|
||||
self.locations.append(datadir)
|
||||
|
||||
# self.locations[0] is where we save the custom scripts
|
||||
if platform.platform() == 'Windows':
|
||||
toolsdir = os.path.expanduser('~/gedit/tools')
|
||||
toolsdir = os.path.expanduser('~/pluma/tools')
|
||||
else:
|
||||
userdir = os.getenv('MATE22_USER_DIR')
|
||||
if userdir:
|
||||
toolsdir = os.path.join(userdir, 'gedit/tools')
|
||||
toolsdir = os.path.join(userdir, 'pluma/tools')
|
||||
else:
|
||||
toolsdir = os.path.expanduser('~/.mate2/gedit/tools')
|
||||
toolsdir = os.path.expanduser('~/.mate2/pluma/tools')
|
||||
|
||||
self.locations.insert(0, toolsdir);
|
||||
|
||||
@@ -80,9 +80,9 @@ class ToolLibrary(Singleton):
|
||||
import xml.etree.ElementTree as et
|
||||
userdir = os.getenv('MATE22_USER_DIR')
|
||||
if userdir:
|
||||
filename = os.path.join(userdir, 'gedit/gedit-tools.xml')
|
||||
filename = os.path.join(userdir, 'pluma/pluma-tools.xml')
|
||||
else:
|
||||
filename = os.path.expanduser('~/.mate2/gedit/gedit-tools.xml')
|
||||
filename = os.path.expanduser('~/.mate2/pluma/pluma-tools.xml')
|
||||
|
||||
if not os.path.isfile(filename):
|
||||
return
|
||||
@@ -250,7 +250,7 @@ class Tool(object):
|
||||
|
||||
for line in fp:
|
||||
if not in_block:
|
||||
in_block = line.startswith('# [Gedit Tool]')
|
||||
in_block = line.startswith('# [Pluma Tool]')
|
||||
continue
|
||||
if line.startswith('##') or line.startswith('# #'): continue
|
||||
if not line.startswith('# '): break
|
||||
@@ -389,7 +389,7 @@ class Tool(object):
|
||||
|
||||
# before entering the data block
|
||||
for line in fp:
|
||||
if line.startswith('# [Gedit Tool]'):
|
||||
if line.startswith('# [Pluma Tool]'):
|
||||
break
|
||||
lines.append(line)
|
||||
# in the block:
|
||||
@@ -407,7 +407,7 @@ class Tool(object):
|
||||
return lines
|
||||
|
||||
def _dump_properties(self):
|
||||
lines = ['# [Gedit Tool]']
|
||||
lines = ['# [Pluma Tool]']
|
||||
for item in self._properties.iteritems():
|
||||
if item[0] in self._transform:
|
||||
lines.append('# %s=%s' % (item[0], self._transform[item[0]][1](item[1])))
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Gedit External Tools plugin
|
||||
# Pluma External Tools plugin
|
||||
# Copyright (C) 2005-2006 Steve Frécinaux <steve@istique.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
__all__ = ('Manager', )
|
||||
|
||||
import gedit
|
||||
import pluma
|
||||
import gtk
|
||||
import gtksourceview2 as gsv
|
||||
import os.path
|
||||
@@ -114,7 +114,7 @@ class LanguagesPopup(gtk.Window):
|
||||
|
||||
def init_languages(self, languages):
|
||||
manager = gsv.LanguageManager()
|
||||
langs = gedit.language_manager_list_languages_sorted(manager, True)
|
||||
langs = pluma.language_manager_list_languages_sorted(manager, True)
|
||||
|
||||
self.model.append([_('All languages'), None, not languages])
|
||||
self.model.append(['-', None, False])
|
||||
@@ -548,7 +548,7 @@ class Manager:
|
||||
|
||||
self.script_hash = self.compute_hash(script)
|
||||
contenttype = gio.content_type_guess(data=script)
|
||||
lmanager = gedit.get_language_manager()
|
||||
lmanager = pluma.get_language_manager()
|
||||
language = lmanager.guess_language(content_type=contenttype)
|
||||
|
||||
if language is not None:
|
||||
@@ -818,7 +818,7 @@ class Manager:
|
||||
|
||||
def on_tool_manager_dialog_response(self, dialog, response):
|
||||
if response == gtk.RESPONSE_HELP:
|
||||
gedit.help_display(self.dialog, 'gedit', 'gedit-external-tools-plugin')
|
||||
pluma.help_display(self.dialog, 'pluma', 'pluma-external-tools-plugin')
|
||||
return
|
||||
|
||||
self.on_tool_manager_dialog_focus_out(dialog, None)
|
||||
@@ -830,7 +830,7 @@ class Manager:
|
||||
def on_tool_manager_dialog_focus_out(self, dialog, event):
|
||||
self.save_current_tool()
|
||||
|
||||
for window in gedit.app_get_default().get_windows():
|
||||
for window in pluma.app_get_default().get_windows():
|
||||
helper = window.get_data("ExternalToolsPluginWindowData")
|
||||
helper.menu.update()
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Gedit External Tools plugin
|
||||
# Pluma External Tools plugin
|
||||
# Copyright (C) 2005-2006 Steve Frécinaux <steve@istique.net>
|
||||
# Copyright (C) 2010 Per Arneng <per.arneng@anyplanet.com>
|
||||
#
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
__all__ = ('OutputPanel', 'UniqueById')
|
||||
|
||||
import gtk, gedit
|
||||
import gtk, pluma
|
||||
import pango
|
||||
import gobject
|
||||
import os
|
||||
@@ -217,7 +217,7 @@ class OutputPanel(UniqueById):
|
||||
gfile = self.file_lookup.lookup(link.path)
|
||||
|
||||
if gfile:
|
||||
gedit.commands.load_uri(self.window, gfile.get_uri(), None,
|
||||
pluma.commands.load_uri(self.window, gfile.get_uri(), None,
|
||||
link.line_nr)
|
||||
gobject.idle_add(self.idle_grab_focus)
|
||||
|
||||
|
@@ -122,7 +122,7 @@
|
||||
</row>
|
||||
</data>
|
||||
</object>
|
||||
<object class="GeditDocument" id="commands_buffer">
|
||||
<object class="PlumaDocument" id="commands_buffer">
|
||||
<property name="highlight-matching-brackets">True</property>
|
||||
</object>
|
||||
<object class="GtkDialog" id="tool-manager-dialog">
|
||||
@@ -517,7 +517,7 @@
|
||||
<property name="vscrollbar_policy">automatic</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GeditView" id="commands">
|
||||
<object class="PlumaView" id="commands">
|
||||
<property name="buffer">commands_buffer</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="auto-indent">True</property>
|
||||
|
Reference in New Issue
Block a user