summaryrefslogtreecommitdiff
path: root/plugins/snippets
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/snippets')
-rwxr-xr-xplugins/snippets/Makefile.am8
-rwxr-xr-xplugins/snippets/data/Makefile.am2
-rwxr-xr-xplugins/snippets/data/c.xml4
-rwxr-xr-xplugins/snippets/data/chdr.xml4
-rwxr-xr-xplugins/snippets/data/cpp.xml4
-rwxr-xr-xplugins/snippets/data/docbook.xml4
-rwxr-xr-xplugins/snippets/data/html.xml8
-rwxr-xr-xplugins/snippets/data/java.xml2
-rwxr-xr-xplugins/snippets/data/lang/Makefile.am2
-rwxr-xr-xplugins/snippets/data/latex.xml2
-rwxr-xr-xplugins/snippets/data/python.xml4
-rwxr-xr-xplugins/snippets/data/snippets.xml56
-rwxr-xr-xplugins/snippets/data/xslt.xml4
-rwxr-xr-xplugins/snippets/snippets.pluma-plugin.desktop.in (renamed from plugins/snippets/snippets.gedit-plugin.desktop.in)4
-rwxr-xr-xplugins/snippets/snippets/Completion.py4
-rwxr-xr-xplugins/snippets/snippets/Document.py54
-rwxr-xr-xplugins/snippets/snippets/Helper.py8
-rwxr-xr-xplugins/snippets/snippets/Library.py2
-rwxr-xr-xplugins/snippets/snippets/Makefile.am4
-rwxr-xr-xplugins/snippets/snippets/Manager.py12
-rwxr-xr-xplugins/snippets/snippets/Parser.py2
-rwxr-xr-xplugins/snippets/snippets/Placeholder.py8
-rwxr-xr-xplugins/snippets/snippets/Snippet.py2
-rwxr-xr-xplugins/snippets/snippets/SubstitutionParser.py2
-rwxr-xr-xplugins/snippets/snippets/WindowHelper.py20
-rwxr-xr-xplugins/snippets/snippets/__init__.py18
-rwxr-xr-xplugins/snippets/snippets/snippets.ui4
27 files changed, 124 insertions, 124 deletions
diff --git a/plugins/snippets/Makefile.am b/plugins/snippets/Makefile.am
index 06f0009b..7d536d25 100755
--- a/plugins/snippets/Makefile.am
+++ b/plugins/snippets/Makefile.am
@@ -1,11 +1,11 @@
# Python snippets plugin
SUBDIRS = snippets data
-plugindir = $(GEDIT_PLUGINS_LIBS_DIR)
+plugindir = $(PLUMA_PLUGINS_LIBS_DIR)
-plugin_in_files = snippets.gedit-plugin.desktop.in
-%.gedit-plugin: %.gedit-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
+plugin_in_files = snippets.pluma-plugin.desktop.in
+%.pluma-plugin: %.pluma-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
-plugin_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin)
+plugin_DATA = $(plugin_in_files:.pluma-plugin.desktop.in=.pluma-plugin)
EXTRA_DIST = $(plugin_in_files)
diff --git a/plugins/snippets/data/Makefile.am b/plugins/snippets/data/Makefile.am
index 8ec40419..0859f602 100755
--- a/plugins/snippets/data/Makefile.am
+++ b/plugins/snippets/data/Makefile.am
@@ -26,7 +26,7 @@ snippets_DATA = \
xml.xml \
xslt.xml
-snippetsdir = $(GEDIT_PLUGINS_DATA_DIR)/snippets
+snippetsdir = $(PLUMA_PLUGINS_DATA_DIR)/snippets
EXTRA_DIST = $(snippets_DATA)
diff --git a/plugins/snippets/data/c.xml b/plugins/snippets/data/c.xml
index 61171cb8..60188bd3 100755
--- a/plugins/snippets/data/c.xml
+++ b/plugins/snippets/data/c.xml
@@ -2,7 +2,7 @@
<snippets language="C">
<snippet id="gpl">
<text><![CDATA[/*
- * ${1:[$GEDIT_CURRENT_DOCUMENT_NAME,<filename>]}
+ * ${1:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]}
* This file is part of ${2:<program name>}
*
* Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4:
@@ -34,7 +34,7 @@ $0]]></text>
</snippet>
<snippet id="lgpl">
<text><![CDATA[/*
- * ${1:[$GEDIT_CURRENT_DOCUMENT_NAME,<filename>]}
+ * ${1:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]}
* This file is part of ${2:<library name>}
*
* Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4:
diff --git a/plugins/snippets/data/chdr.xml b/plugins/snippets/data/chdr.xml
index f71ea901..b88f2274 100755
--- a/plugins/snippets/data/chdr.xml
+++ b/plugins/snippets/data/chdr.xml
@@ -34,7 +34,7 @@ $0]]></text>
</snippet>
<snippet id="gpl">
<text><![CDATA[/*
- * ${1:[$GEDIT_CURRENT_DOCUMENT_NAME,<filename>]}
+ * ${1:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]}
* This file is part of ${2:<program name>}
*
* Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4:
@@ -66,7 +66,7 @@ $0]]></text>
</snippet>
<snippet id="lgpl">
<text><![CDATA[/*
- * ${1:[$GEDIT_CURRENT_DOCUMENT_NAME,<filename>]}
+ * ${1:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]}
* This file is part of ${2:<library name>}
*
* Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4:
diff --git a/plugins/snippets/data/cpp.xml b/plugins/snippets/data/cpp.xml
index 7c7ccabd..e514a3e3 100755
--- a/plugins/snippets/data/cpp.xml
+++ b/plugins/snippets/data/cpp.xml
@@ -105,7 +105,7 @@ $0]]></text>
</snippet>
<snippet id="gpl">
<text><![CDATA[/*
- * ${1:[$GEDIT_CURRENT_DOCUMENT_NAME,<filename>]}
+ * ${1:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]}
* This file is part of ${2:<program name>}
*
* Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4:
@@ -137,7 +137,7 @@ except KeyError:
</snippet>
<snippet id="lgpl">
<text><![CDATA[/*
- * ${1:[$GEDIT_CURRENT_DOCUMENT_NAME,<filename>]}
+ * ${1:[$PLUMA_CURRENT_DOCUMENT_NAME,<filename>]}
* This file is part of ${2:<library name>}
*
* Copyright (C) $<3: import datetime; return str(datetime.date.today().year)> - $<4:
diff --git a/plugins/snippets/data/docbook.xml b/plugins/snippets/data/docbook.xml
index 3159b603..8a96a059 100755
--- a/plugins/snippets/data/docbook.xml
+++ b/plugins/snippets/data/docbook.xml
@@ -34,13 +34,13 @@
<accelerator/>
</snippet>
<snippet id="appwrap">
- <text><![CDATA[<application>$GEDIT_SELECTED_TEXT</application>]]></text>
+ <text><![CDATA[<application>$PLUMA_SELECTED_TEXT</application>]]></text>
<tag>application</tag>
<description>application tag</description>
<accelerator/>
</snippet>
<snippet id="enclose">
- <text><![CDATA[<${1}>$GEDIT_SELECTED_TEXT</${1}>]]></text>
+ <text><![CDATA[<${1}>$PLUMA_SELECTED_TEXT</${1}>]]></text>
<tag>enclose</tag>
<description>enclose selected text</description>
<accelerator/>
diff --git a/plugins/snippets/data/html.xml b/plugins/snippets/data/html.xml
index d294f934..3c35e599 100755
--- a/plugins/snippets/data/html.xml
+++ b/plugins/snippets/data/html.xml
@@ -54,14 +54,14 @@ $0]]></text>
<description>Date</description>
</snippet>
<snippet id="ref">
- <text><![CDATA[<a href="${1:http://somesite.com/}">${2:$GEDIT_SELECTED_TEXT}</a>
+ <text><![CDATA[<a href="${1:http://somesite.com/}">${2:$PLUMA_SELECTED_TEXT}</a>
]]></text>
<accelerator><![CDATA[<Shift><Alt>l]]></accelerator>
<description>Wrap Selection as Link</description>
<tag>ref</tag>
</snippet>
<snippet id="open/close">
- <text><![CDATA[<${1:p}>$GEDIT_SELECTED_TEXT</${1}>]]></text>
+ <text><![CDATA[<${1:p}>$PLUMA_SELECTED_TEXT</${1}>]]></text>
<accelerator><![CDATA[<Shift><Alt>w]]></accelerator>
<description>Wrap Selection in Open/Close Tag</description>
</snippet>
@@ -96,7 +96,7 @@ $0]]></text>
</snippet>
<snippet id="div">
<text><![CDATA[<div ${1}>
- ${0:$GEDIT_SELECTED_TEXT}
+ ${0:$PLUMA_SELECTED_TEXT}
</div>]]></text>
<description>Div</description>
<tag>div</tag>
@@ -117,7 +117,7 @@ $0]]></text>
<tag>form</tag>
</snippet>
<snippet id="h">
- <text><![CDATA[<h${1:1} id="${2}">${3:$GEDIT_SELECTED_TEXT}</h${1}>
+ <text><![CDATA[<h${1:1} id="${2}">${3:$PLUMA_SELECTED_TEXT}</h${1}>
$0]]></text>
<description>Heading</description>
<tag>h</tag>
diff --git a/plugins/snippets/data/java.xml b/plugins/snippets/data/java.xml
index 043a5dd3..fce31859 100755
--- a/plugins/snippets/data/java.xml
+++ b/plugins/snippets/data/java.xml
@@ -69,7 +69,7 @@ $0
</snippet>
<snippet id="try/catch">
<text><![CDATA[try {
- $GEDIT_SELECTED_TEXT
+ $PLUMA_SELECTED_TEXT
}
catch (Exception e) {
${1:e.printStackTrace();}
diff --git a/plugins/snippets/data/lang/Makefile.am b/plugins/snippets/data/lang/Makefile.am
index 8a497c12..d63e44e6 100755
--- a/plugins/snippets/data/lang/Makefile.am
+++ b/plugins/snippets/data/lang/Makefile.am
@@ -2,7 +2,7 @@
lang_DATA = \
snippets.lang
-langdir = $(GEDIT_PLUGINS_DATA_DIR)/snippets/lang
+langdir = $(PLUMA_PLUGINS_DATA_DIR)/snippets/lang
EXTRA_DIST = $(lang_DATA)
diff --git a/plugins/snippets/data/latex.xml b/plugins/snippets/data/latex.xml
index 71672ec8..bfa1934f 100755
--- a/plugins/snippets/data/latex.xml
+++ b/plugins/snippets/data/latex.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<snippets language="LaTeX">
<snippet id="command">
- <text><![CDATA[{\\${1:bf} $GEDIT_SELECTED_TEXT}]]></text>
+ <text><![CDATA[{\\${1:bf} $PLUMA_SELECTED_TEXT}]]></text>
<accelerator><![CDATA[<Shift><Alt>w]]></accelerator>
<description>Wrap Selection in Command</description>
</snippet>
diff --git a/plugins/snippets/data/python.xml b/plugins/snippets/data/python.xml
index a25617b8..3829c3a0 100755
--- a/plugins/snippets/data/python.xml
+++ b/plugins/snippets/data/python.xml
@@ -74,12 +74,12 @@ $0]]></text>
<description>while loop</description>
</snippet>
<snippet id="insert">
- <text><![CDATA["${1:$GEDIT_SELECTED_TEXT}"]]></text>
+ <text><![CDATA["${1:$PLUMA_SELECTED_TEXT}"]]></text>
<accelerator><![CDATA[<Control>2]]></accelerator>
<description>Inside String: Insert "…"</description>
</snippet>
<snippet id="insert-1">
- <text><![CDATA['${1:$GEDIT_SELECTED_TEXT}']]></text>
+ <text><![CDATA['${1:$PLUMA_SELECTED_TEXT}']]></text>
<accelerator><![CDATA[<Control>apostrophe]]></accelerator>
<description>Inside String: Insert '…'</description>
</snippet>
diff --git a/plugins/snippets/data/snippets.xml b/plugins/snippets/data/snippets.xml
index ee405e6d..2718461b 100755
--- a/plugins/snippets/data/snippets.xml
+++ b/plugins/snippets/data/snippets.xml
@@ -26,73 +26,73 @@
<tag>regex</tag>
</snippet>
<snippet id="$-CURRENT_DOCUMENT_PATH">
- <text><![CDATA[\$GEDIT_CURRENT_DOCUMENT_PATH]]></text>
- <description>Gedit Current Document Path Variable</description>
+ <text><![CDATA[\$PLUMA_CURRENT_DOCUMENT_PATH]]></text>
+ <description>Pluma Current Document Path Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-CURRENT_DOCUMENT_NAME">
- <text><![CDATA[\$GEDIT_CURRENT_DOCUMENT_NAME]]></text>
- <description>Gedit Current Document Name Variable</description>
+ <text><![CDATA[\$PLUMA_CURRENT_DOCUMENT_NAME]]></text>
+ <description>Pluma Current Document Name Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-CURRENT_DOCUMENT_URI">
- <text><![CDATA[\$GEDIT_CURRENT_DOCUMENT_URI]]></text>
- <description>Gedit Current Document Uri Variable</description>
+ <text><![CDATA[\$PLUMA_CURRENT_DOCUMENT_URI]]></text>
+ <description>Pluma Current Document Uri Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-CURRENT_DOCUMENT_SCHEME">
- <text><![CDATA[\$GEDIT_CURRENT_DOCUMENT_SCHEME]]></text>
- <description>Gedit Current Document Scheme Variable</description>
+ <text><![CDATA[\$PLUMA_CURRENT_DOCUMENT_SCHEME]]></text>
+ <description>Pluma Current Document Scheme Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-CURRENT_DOCUMENT_TYPE">
- <text><![CDATA[\$GEDIT_CURRENT_DOCUMENT_TYPE]]></text>
- <description>Gedit Current Document Type Variable</description>
+ <text><![CDATA[\$PLUMA_CURRENT_DOCUMENT_TYPE]]></text>
+ <description>Pluma Current Document Type Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-DOCUMENTS_URI">
- <text><![CDATA[\$GEDIT_DOCUMENTS_URI]]></text>
- <description>Gedit Documents Uri Variable</description>
+ <text><![CDATA[\$PLUMA_DOCUMENTS_URI]]></text>
+ <description>Pluma Documents Uri Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-DOCUMENTS_PATH">
- <text><![CDATA[\$GEDIT_DOCUMENTS_PATH]]></text>
- <description>Gedit Documents Path Variable</description>
+ <text><![CDATA[\$PLUMA_DOCUMENTS_PATH]]></text>
+ <description>Pluma Documents Path Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-SELECTED_TEXT">
- <text><![CDATA[\$GEDIT_SELECTED_TEXT]]></text>
- <description>Gedit Selected Text Variable</description>
+ <text><![CDATA[\$PLUMA_SELECTED_TEXT]]></text>
+ <description>Pluma Selected Text Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-CURRENT_WORD">
- <text><![CDATA[\$GEDIT_CURRENT_WORD]]></text>
- <description>Gedit Current Word Variable</description>
+ <text><![CDATA[\$PLUMA_CURRENT_WORD]]></text>
+ <description>Pluma Current Word Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-CURRENT_LINE">
- <text><![CDATA[\$GEDIT_CURRENT_LINE]]></text>
- <description>Gedit Current Line Variable</description>
+ <text><![CDATA[\$PLUMA_CURRENT_LINE]]></text>
+ <description>Pluma Current Line Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-CURRENT_LINE_NUMBER">
- <text><![CDATA[\$GEDIT_CURRENT_LINE_NUMBER]]></text>
- <description>Gedit Current Line Number Variable</description>
+ <text><![CDATA[\$PLUMA_CURRENT_LINE_NUMBER]]></text>
+ <description>Pluma Current Line Number Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-DROP_FILENAME">
- <text><![CDATA[\$GEDIT_DROP_FILENAME]]></text>
- <description>Gedit Drop Filename Variable</description>
+ <text><![CDATA[\$PLUMA_DROP_FILENAME]]></text>
+ <description>Pluma Drop Filename Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-DROP_REL_FILENAME">
- <text><![CDATA[\$GEDIT_DROP_REL_FILENAME]]></text>
- <description>Gedit Drop Relative Filename Variable</description>
+ <text><![CDATA[\$PLUMA_DROP_REL_FILENAME]]></text>
+ <description>Pluma Drop Relative Filename Variable</description>
<tag>$</tag>
</snippet>
<snippet id="$-DROP_MIME_TYPE">
- <text><![CDATA[\$GEDIT_DROP_MIME_TYPE]]></text>
- <description>Gedit Drop Mime Type Variable</description>
+ <text><![CDATA[\$PLUMA_DROP_MIME_TYPE]]></text>
+ <description>Pluma Drop Mime Type Variable</description>
<tag>$</tag>
</snippet>
</snippets>
diff --git a/plugins/snippets/data/xslt.xml b/plugins/snippets/data/xslt.xml
index 0ff5cc15..9a470b18 100755
--- a/plugins/snippets/data/xslt.xml
+++ b/plugins/snippets/data/xslt.xml
@@ -103,13 +103,13 @@ $0]]></text>
<tag>attr</tag>
</snippet>
<snippet id="text">
- <text><![CDATA[<xsl:text>${1:$GEDIT_SELECTED_TEXT}</xsl:text>
+ <text><![CDATA[<xsl:text>${1:$PLUMA_SELECTED_TEXT}</xsl:text>
]]></text>
<description>Text</description>
<tag>text</tag>
</snippet>
<snippet id="comment">
- <text><![CDATA[<xsl:comment>${1:$GEDIT_SELECTED_TEXT}</xsl:comment>
+ <text><![CDATA[<xsl:comment>${1:$PLUMA_SELECTED_TEXT}</xsl:comment>
]]></text>
<description>Comment</description>
<tag>comment</tag>
diff --git a/plugins/snippets/snippets.gedit-plugin.desktop.in b/plugins/snippets/snippets.pluma-plugin.desktop.in
index dc3c8281..4813fe7d 100755
--- a/plugins/snippets/snippets.gedit-plugin.desktop.in
+++ b/plugins/snippets/snippets.pluma-plugin.desktop.in
@@ -1,4 +1,4 @@
-[Gedit Plugin]
+[Pluma Plugin]
Loader=python
Module=snippets
IAge=2
@@ -6,4 +6,4 @@ _Name=Snippets
_Description=Insert often-used pieces of text in a fast way
Authors=Jesse van den Kieboom <[email protected]>
Copyright=Copyright © 2005 Jesse van den Kieboom
-Website=http://www.gedit.org
+Website=http://www.pluma.org
diff --git a/plugins/snippets/snippets/Completion.py b/plugins/snippets/snippets/Completion.py
index d83915a5..4f24150c 100755
--- a/plugins/snippets/snippets/Completion.py
+++ b/plugins/snippets/snippets/Completion.py
@@ -1,6 +1,6 @@
import gtksourceview2 as gsv
import gobject
-import gedit
+import pluma
import gtk
from Library import Library
@@ -102,7 +102,7 @@ class Provider(gobject.GObject, gsv.CompletionProvider):
def do_get_info_widget(self, proposal):
if not self.info_widget:
- view = gedit.View(gedit.Document())
+ view = pluma.View(pluma.Document())
manager = get_language_manager()
lang = manager.get_language('snippets')
diff --git a/plugins/snippets/snippets/Document.py b/plugins/snippets/snippets/Document.py
index da166668..368e0f5c 100755
--- a/plugins/snippets/snippets/Document.py
+++ b/plugins/snippets/snippets/Document.py
@@ -1,4 +1,4 @@
-# Gedit snippets plugin
+# Pluma snippets plugin
# Copyright (C) 2005-2006 Jesse van den Kieboom <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,7 @@ import re
import gtk
from gtk import gdk
import gio
-import gedit
+import pluma
import gtksourceview2 as gsv
import gobject
@@ -433,7 +433,7 @@ class Document:
def env_get_documents_uri(self, buf):
toplevel = self.view.get_toplevel()
- if isinstance(toplevel, gedit.Window):
+ if isinstance(toplevel, pluma.Window):
documents_uri = [doc.get_location().get_uri()
for doc in toplevel.get_documents()
if doc.get_location() is not None]
@@ -445,14 +445,14 @@ class Document:
def env_get_documents_path(self, buf):
toplevel = self.view.get_toplevel()
- if isinstance(toplevel, gedit.Window):
+ if isinstance(toplevel, pluma.Window):
documents_location = [doc.get_location()
for doc in toplevel.get_documents()
if doc.get_location() is not None]
documents_path = [location.get_path()
for location in documents_location
- if gedit.utils.uri_has_file_scheme(location.get_uri())]
+ if pluma.utils.uri_has_file_scheme(location.get_uri())]
else:
documents_path = []
@@ -461,25 +461,25 @@ class Document:
def update_environment(self):
buf = self.view.get_buffer()
- variables = {'GEDIT_SELECTED_TEXT': self.env_get_selected_text,
- 'GEDIT_CURRENT_WORD': self.env_get_current_word,
- 'GEDIT_CURRENT_LINE': self.env_get_current_line,
- 'GEDIT_CURRENT_LINE_NUMBER': self.env_get_current_line_number,
- 'GEDIT_CURRENT_DOCUMENT_URI': self.env_get_document_uri,
- 'GEDIT_CURRENT_DOCUMENT_NAME': self.env_get_document_name,
- 'GEDIT_CURRENT_DOCUMENT_SCHEME': self.env_get_document_scheme,
- 'GEDIT_CURRENT_DOCUMENT_PATH': self.env_get_document_path,
- 'GEDIT_CURRENT_DOCUMENT_DIR': self.env_get_document_dir,
- 'GEDIT_CURRENT_DOCUMENT_TYPE': self.env_get_document_type,
- 'GEDIT_DOCUMENTS_URI': self.env_get_documents_uri,
- 'GEDIT_DOCUMENTS_PATH': self.env_get_documents_path,
+ variables = {'PLUMA_SELECTED_TEXT': self.env_get_selected_text,
+ 'PLUMA_CURRENT_WORD': self.env_get_current_word,
+ 'PLUMA_CURRENT_LINE': self.env_get_current_line,
+ 'PLUMA_CURRENT_LINE_NUMBER': self.env_get_current_line_number,
+ 'PLUMA_CURRENT_DOCUMENT_URI': self.env_get_document_uri,
+ 'PLUMA_CURRENT_DOCUMENT_NAME': self.env_get_document_name,
+ 'PLUMA_CURRENT_DOCUMENT_SCHEME': self.env_get_document_scheme,
+ 'PLUMA_CURRENT_DOCUMENT_PATH': self.env_get_document_path,
+ 'PLUMA_CURRENT_DOCUMENT_DIR': self.env_get_document_dir,
+ 'PLUMA_CURRENT_DOCUMENT_TYPE': self.env_get_document_type,
+ 'PLUMA_DOCUMENTS_URI': self.env_get_documents_uri,
+ 'PLUMA_DOCUMENTS_PATH': self.env_get_documents_path,
}
for var in variables:
os.environ[var] = variables[var](buf)
def uses_current_word(self, snippet):
- matches = re.findall('(\\\\*)\\$GEDIT_CURRENT_WORD', snippet['text'])
+ matches = re.findall('(\\\\*)\\$PLUMA_CURRENT_WORD', snippet['text'])
for match in matches:
if len(match) % 2 == 0:
@@ -488,7 +488,7 @@ class Document:
return False
def uses_current_line(self, snippet):
- matches = re.findall('(\\\\*)\\$GEDIT_CURRENT_LINE', snippet['text'])
+ matches = re.findall('(\\\\*)\\$PLUMA_CURRENT_LINE', snippet['text'])
for match in matches:
if len(match) % 2 == 0:
@@ -865,19 +865,19 @@ class Document:
dirname = ''
ruri = ''
- if gedit.utils.uri_has_file_scheme(uri):
+ if pluma.utils.uri_has_file_scheme(uri):
pathname = gfile.get_path()
dirname = gfile.get_parent().get_path()
name = os.path.basename(uri)
scheme = gfile.get_uri_scheme()
- os.environ['GEDIT_DROP_DOCUMENT_URI'] = uri
- os.environ['GEDIT_DROP_DOCUMENT_NAME'] = name
- os.environ['GEDIT_DROP_DOCUMENT_SCHEME'] = scheme
- os.environ['GEDIT_DROP_DOCUMENT_PATH'] = pathname
- os.environ['GEDIT_DROP_DOCUMENT_DIR'] = dirname
- os.environ['GEDIT_DROP_DOCUMENT_TYPE'] = mime
+ os.environ['PLUMA_DROP_DOCUMENT_URI'] = uri
+ os.environ['PLUMA_DROP_DOCUMENT_NAME'] = name
+ os.environ['PLUMA_DROP_DOCUMENT_SCHEME'] = scheme
+ os.environ['PLUMA_DROP_DOCUMENT_PATH'] = pathname
+ os.environ['PLUMA_DROP_DOCUMENT_DIR'] = dirname
+ os.environ['PLUMA_DROP_DOCUMENT_TYPE'] = mime
buf = self.view.get_buffer()
location = buf.get_location()
@@ -886,7 +886,7 @@ class Document:
relpath = self.relative_path(ruri, uri, mime)
- os.environ['GEDIT_DROP_DOCUMENT_RELATIVE_PATH'] = relpath
+ os.environ['PLUMA_DROP_DOCUMENT_RELATIVE_PATH'] = relpath
mark = buf.get_mark('gtk_drag_target')
diff --git a/plugins/snippets/snippets/Helper.py b/plugins/snippets/snippets/Helper.py
index de363360..60ae1c79 100755
--- a/plugins/snippets/snippets/Helper.py
+++ b/plugins/snippets/snippets/Helper.py
@@ -1,4 +1,4 @@
-# Gedit snippets plugin
+# Pluma snippets plugin
# Copyright (C) 2005-2006 Jesse van den Kieboom <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
@@ -62,7 +62,7 @@ def insert_with_indent(view, piter, text, indentfirst = True, context = None):
text = spaces_instead_of_tabs(view, text)
lines = text.split('\n')
- view.get_buffer().set_data('GeditSnippetsPluginContext', context)
+ view.get_buffer().set_data('PlumaSnippetsPluginContext', context)
if len(lines) == 1:
view.get_buffer().insert(piter, text)
@@ -79,10 +79,10 @@ def insert_with_indent(view, piter, text, indentfirst = True, context = None):
view.get_buffer().insert(piter, text[:-1])
- view.get_buffer().set_data('GeditSnippetsPluginContext', None)
+ view.get_buffer().set_data('PlumaSnippetsPluginContext', None)
def get_buffer_context(buf):
- return buf.get_data('GeditSnippetsPluginContext')
+ return buf.get_data('PlumaSnippetsPluginContext')
def snippets_debug(*s):
return
diff --git a/plugins/snippets/snippets/Library.py b/plugins/snippets/snippets/Library.py
index 4717280c..792f0f7e 100755
--- a/plugins/snippets/snippets/Library.py
+++ b/plugins/snippets/snippets/Library.py
@@ -1,4 +1,4 @@
-# Gedit snippets plugin
+# Pluma snippets plugin
# Copyright (C) 2005-2006 Jesse van den Kieboom <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
diff --git a/plugins/snippets/snippets/Makefile.am b/plugins/snippets/snippets/Makefile.am
index 7a05b562..086b5968 100755
--- a/plugins/snippets/snippets/Makefile.am
+++ b/plugins/snippets/snippets/Makefile.am
@@ -1,5 +1,5 @@
# Python snippets plugin
-plugindir = $(GEDIT_PLUGINS_LIBS_DIR)/snippets
+plugindir = $(PLUMA_PLUGINS_LIBS_DIR)/snippets
plugin_PYTHON = \
__init__.py \
@@ -17,7 +17,7 @@ plugin_PYTHON = \
LanguageManager.py \
Completion.py
-uidir = $(GEDIT_PLUGINS_DATA_DIR)/snippets/ui
+uidir = $(PLUMA_PLUGINS_DATA_DIR)/snippets/ui
ui_DATA = snippets.ui
EXTRA_DIST = $(ui_DATA)
diff --git a/plugins/snippets/snippets/Manager.py b/plugins/snippets/snippets/Manager.py
index 16acbdb4..96220c6e 100755
--- a/plugins/snippets/snippets/Manager.py
+++ b/plugins/snippets/snippets/Manager.py
@@ -1,4 +1,4 @@
-# Gedit snippets plugin
+# Pluma snippets plugin
# Copyright (C) 2005-2006 Jesse van den Kieboom <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
@@ -24,7 +24,7 @@ import gtk
from gtk import gdk
import gtksourceview2 as gsv
import pango
-import gedit
+import pluma
import gio
from Snippet import Snippet
@@ -95,7 +95,7 @@ class Manager:
self.tree_view.expand_row(path, False)
def build_model(self, force_reload = False):
- window = gedit.app_get_default().get_active_window()
+ window = pluma.app_get_default().get_active_window()
if window:
view = window.get_active_view()
@@ -116,7 +116,7 @@ class Manager:
self.model = gtk.TreeStore(str, str, object)
self.model.set_sort_column_id(self.SORT_COLUMN, gtk.SORT_ASCENDING)
manager = get_language_manager()
- langs = gedit.language_manager_list_languages_sorted(manager, True)
+ langs = pluma.language_manager_list_languages_sorted(manager, True)
piter = self.model.append(None, (_('Global'), '', None))
# Add dummy node
@@ -618,7 +618,7 @@ class Manager:
def on_dialog_snippets_response(self, dlg, resp):
if resp == gtk.RESPONSE_HELP:
- gedit.help_display(self.dlg, 'gedit', 'gedit-snippets-plugin')
+ pluma.help_display(self.dlg, 'pluma', 'pluma-snippets-plugin')
return
self.dlg.destroy()
@@ -765,7 +765,7 @@ class Manager:
success = True
for filename in filenames:
- if not gedit.utils.uri_has_file_scheme(filename):
+ if not pluma.utils.uri_has_file_scheme(filename):
continue
# Remove file://
diff --git a/plugins/snippets/snippets/Parser.py b/plugins/snippets/snippets/Parser.py
index 3bbaf6e7..0c638df7 100755
--- a/plugins/snippets/snippets/Parser.py
+++ b/plugins/snippets/snippets/Parser.py
@@ -1,4 +1,4 @@
-# Gedit snippets plugin
+# Pluma snippets plugin
# Copyright (C) 2006-2007 Jesse van den Kieboom <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
diff --git a/plugins/snippets/snippets/Placeholder.py b/plugins/snippets/snippets/Placeholder.py
index c43eecac..45b5b508 100755
--- a/plugins/snippets/snippets/Placeholder.py
+++ b/plugins/snippets/snippets/Placeholder.py
@@ -1,4 +1,4 @@
-# Gedit snippets plugin
+# Pluma snippets plugin
# Copyright (C) 2005-2006 Jesse van den Kieboom <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
@@ -524,7 +524,7 @@ class PlaceholderEval(PlaceholderExpand):
# SIGALRM is not supported on all platforms (e.g. windows). Timeout
# with SIGALRM will not be used on those platforms. This will
- # potentially block gedit if you have a placeholder which gets stuck,
+ # potentially block pluma if you have a placeholder which gets stuck,
# but it's better than not supporting them at all. At some point we
# might have proper thread support and we can fix this in a better way
def timeout_supported(self):
@@ -577,9 +577,9 @@ class PlaceholderEval(PlaceholderExpand):
if 'process_snippet' in self.namespace:
try:
# Install a sigalarm signal. This is a HACK to make sure
- # gedit doesn't get freezed by someone creating a python
+ # pluma doesn't get freezed by someone creating a python
# placeholder which for instance loops indefinately. Since
- # the code is executed synchronously it will hang gedit. With
+ # the code is executed synchronously it will hang pluma. With
# the alarm signal we raise an exception and catch this
# (see below). We show an error message and return False.
# ___this is a HACK___ and should be fixed properly (I just
diff --git a/plugins/snippets/snippets/Snippet.py b/plugins/snippets/snippets/Snippet.py
index d7baead5..ae81fcfc 100755
--- a/plugins/snippets/snippets/Snippet.py
+++ b/plugins/snippets/snippets/Snippet.py
@@ -1,4 +1,4 @@
-# Gedit snippets plugin
+# Pluma snippets plugin
# Copyright (C) 2005-2006 Jesse van den Kieboom <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
diff --git a/plugins/snippets/snippets/SubstitutionParser.py b/plugins/snippets/snippets/SubstitutionParser.py
index 6522222b..a41f5a6a 100755
--- a/plugins/snippets/snippets/SubstitutionParser.py
+++ b/plugins/snippets/snippets/SubstitutionParser.py
@@ -1,4 +1,4 @@
-# Gedit snippets plugin
+# Pluma snippets plugin
# Copyright (C) 2006-2007 Jesse van den Kieboom <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
diff --git a/plugins/snippets/snippets/WindowHelper.py b/plugins/snippets/snippets/WindowHelper.py
index 29bf3a58..a5f238ae 100755
--- a/plugins/snippets/snippets/WindowHelper.py
+++ b/plugins/snippets/snippets/WindowHelper.py
@@ -1,4 +1,4 @@
-# Gedit snippets plugin
+# Pluma snippets plugin
# Copyright (C) 2005-2006 Jesse van den Kieboom <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,7 @@ import gettext
import gtk
from gtk import gdk
-import gedit
+import pluma
from Document import Document
from Library import Library
@@ -46,7 +46,7 @@ class WindowHelper:
# Add controllers to all the current views
for view in self.window.get_views():
- if isinstance(view, gedit.View) and not self.has_controller(view):
+ if isinstance(view, pluma.View) and not self.has_controller(view):
view._snippet_controller = Document(self, view)
self.update()
@@ -61,7 +61,7 @@ class WindowHelper:
# Iterate over all the tabs and remove every controller
for view in self.window.get_views():
- if isinstance(view, gedit.View) and self.has_controller(view):
+ if isinstance(view, pluma.View) and self.has_controller(view):
view._snippet_controller.stop()
view._snippet_controller = None
@@ -72,8 +72,8 @@ class WindowHelper:
bus = self.window.get_message_bus()
self.messages = {
- 'activate': bus.register('/plugins/snippets', 'activate', ('view', 'iter'), trigger=str, view=gedit.View, iter=gtk.TextIter),
- 'parse-and-activate': bus.register('/plugins/snippets', 'parse-and-activate', ('view', 'iter'), snippet=str, view=gedit.View, iter=gtk.TextIter)
+ 'activate': bus.register('/plugins/snippets', 'activate', ('view', 'iter'), trigger=str, view=pluma.View, iter=gtk.TextIter),
+ 'parse-and-activate': bus.register('/plugins/snippets', 'parse-and-activate', ('view', 'iter'), snippet=str, view=pluma.View, iter=gtk.TextIter)
}
bus.connect('/plugins/snippets', 'activate', self.on_message_activate)
@@ -124,8 +124,8 @@ class WindowHelper:
def insert_menu(self):
manager = self.window.get_ui_manager()
- self.action_group = gtk.ActionGroup("GeditSnippetPluginActions")
- self.action_group.set_translation_domain('gedit')
+ self.action_group = gtk.ActionGroup("PlumaSnippetPluginActions")
+ self.action_group.set_translation_domain('pluma')
self.action_group.add_actions([('ManageSnippets', None,
_('Manage _Snippets...'), \
None, _('Manage snippets'), \
@@ -192,10 +192,10 @@ class WindowHelper:
# Callbacks
def on_tab_added(self, window, tab):
- # Create a new controller for this tab if it has a standard gedit view
+ # Create a new controller for this tab if it has a standard pluma view
view = tab.get_view()
- if isinstance(view, gedit.View) and not self.has_controller(view):
+ if isinstance(view, pluma.View) and not self.has_controller(view):
view._snippet_controller = Document(self, view)
self.update()
diff --git a/plugins/snippets/snippets/__init__.py b/plugins/snippets/snippets/__init__.py
index b21da508..609e3c0c 100755
--- a/plugins/snippets/snippets/__init__.py
+++ b/plugins/snippets/snippets/__init__.py
@@ -1,4 +1,4 @@
-# Gedit snippets plugin
+# Pluma snippets plugin
# Copyright (C) 2005-2006 Jesse van den Kieboom <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,7 @@ import shutil
import gtk
from gtk import gdk
-import gedit
+import pluma
import platform
from WindowHelper import WindowHelper
@@ -29,9 +29,9 @@ from Library import Library
from Manager import Manager
from Snippet import Snippet
-class SnippetsPlugin(gedit.Plugin):
+class SnippetsPlugin(pluma.Plugin):
def __init__(self):
- gedit.Plugin.__init__(self)
+ pluma.Plugin.__init__(self)
self.dlg = None
@@ -39,13 +39,13 @@ class SnippetsPlugin(gedit.Plugin):
library.set_accelerator_callback(self.accelerator_activated)
if platform.platform() == 'Windows':
- snippetsdir = os.path.expanduser('~/gedit/snippets')
+ snippetsdir = os.path.expanduser('~/pluma/snippets')
else:
userdir = os.getenv('MATE22_USER_DIR')
if userdir:
- snippetsdir = os.path.join(userdir, 'gedit/snippets')
+ snippetsdir = os.path.join(userdir, 'pluma/snippets')
else:
- snippetsdir = os.path.expanduser('~/.mate2/gedit/snippets')
+ snippetsdir = os.path.expanduser('~/.mate2/pluma/snippets')
library.set_dirs(snippetsdir, self.system_dirs())
@@ -59,7 +59,7 @@ class SnippetsPlugin(gedit.Plugin):
dirs = []
for d in datadirs.split(os.pathsep):
- d = os.path.join(d, 'gedit-2', 'plugins', 'snippets')
+ d = os.path.join(d, 'pluma-2', 'plugins', 'snippets')
if os.path.isdir(d):
dirs.append(d)
@@ -85,7 +85,7 @@ class SnippetsPlugin(gedit.Plugin):
else:
self.dlg.run()
- window = gedit.app_get_default().get_active_window()
+ window = pluma.app_get_default().get_active_window()
if window:
self.dlg.dlg.set_transient_for(window)
diff --git a/plugins/snippets/snippets/snippets.ui b/plugins/snippets/snippets/snippets.ui
index 426df886..b90324c2 100755
--- a/plugins/snippets/snippets/snippets.ui
+++ b/plugins/snippets/snippets/snippets.ui
@@ -32,7 +32,7 @@
</row>
</data>
</object>
- <object class="GeditDocument" id="source_buffer">
+ <object class="PlumaDocument" id="source_buffer">
<property name="highlight-matching-brackets">True</property>
</object>
<object class="GtkDialog" id="dialog_snippets">
@@ -331,7 +331,7 @@
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
- <object class="GeditView" id="source_view_snippet">
+ <object class="PlumaView" id="source_view_snippet">
<property name="buffer">source_buffer</property>
<property name="visible">True</property>
<property name="auto-indent">True</property>