Commit 43074a23 authored by Paolo Maggi's avatar Paolo Maggi

New snippets plugin by Jesse.

parent 4a87519d
2006-01-14 Jesse van den Kieboom <jesse@icecrew.nl>
* plugins/snippets/*: new snippets plugin
2006-01-13 Frank Arnold <farnold@cvs.gnome.org>
* gedit/gedit-io-error-message-area.c:
......
......@@ -5,7 +5,7 @@ DIST_SUBDIRS = changecase docinfo indent sample sort spell time taglist
SUBDIRS = changecase docinfo indent sample sort time taglist $(SPELL_PLUGIN_DIR)
if ENABLE_PYTHON
DIST_SUBDIRS += pythonconsole modelines
SUBDIRS += pythonconsole modelines
DIST_SUBDIRS += pythonconsole modelines snippets
SUBDIRS += pythonconsole modelines snippets
endif
# Python snippets plugin
SUBDIRS = snippets data
plugindir = $(libdir)/gedit-2/plugins
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_DATA = $(plugin_in_files:.gedit-plugin.desktop.in=.gedit-plugin)
EXTRA_DIST = $(plugin_in_files)
CLEANFILES = $(plugin_DATA)
DISTCLEANFILES = $(plugin_DATA)
# Python snippets plugin
snippets_DATA = gedit-snippets.xml
snippetsdir = $(datadir)/gedit-2/plugins/snippets/
EXTRA_DIST = $(snippets_DATA)
This diff is collapsed.
[Gedit Plugin]
Loader=python
Module=snippets
IAge=2
Name=Snippets
Description=Insert often used pieces of text in a fast way
Authors=Jesse van den Kieboom <jesse@icecrew.nl>
Copyright=Copyright © 2005 Jesse van den Kieboom
# Python snippets plugin
plugindir = $(libdir)/gedit-2/plugins/snippets
plugin_PYTHON = \
__init__.py \
SnippetPluginInstance.py \
Snippet.py \
SnippetPlaceholders.py \
SnippetsDialog.py \
SnippetComplete.py \
functions.py
plugin_DATA = snippets.glade
EXTRA_DIST = snippets.glade
CLEANFILES = *.bak *.gladep
DISTCLEANFILES = *.bak *.gladep
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = plugins/snippets/snippets
DIST_COMMON = $(plugin_PYTHON) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gnome-doc-utils.m4 \
$(top_srcdir)/m4/intltool.m4 $(top_srcdir)/m4/python.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(plugindir)"
pluginPYTHON_INSTALL = $(INSTALL_DATA)
py_compile = $(top_srcdir)/py-compile
pluginDATA_INSTALL = $(INSTALL_DATA)
DATA = $(plugin_DATA)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BONOBO_ACTIVATION_IDL = @BONOBO_ACTIVATION_IDL@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DATADIRNAME = @DATADIRNAME@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DISABLE_DEPRECATED_CFLAGS = @DISABLE_DEPRECATED_CFLAGS@
DOC_USER_FORMATS = @DOC_USER_FORMATS@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ENABLE_PYTHON_FALSE = @ENABLE_PYTHON_FALSE@
ENABLE_PYTHON_TRUE = @ENABLE_PYTHON_TRUE@
ENABLE_SK_FALSE = @ENABLE_SK_FALSE@
ENABLE_SK_TRUE = @ENABLE_SK_TRUE@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
GCONFTOOL = @GCONFTOOL@
GCONF_SCHEMAS_INSTALL_FALSE = @GCONF_SCHEMAS_INSTALL_FALSE@
GCONF_SCHEMAS_INSTALL_TRUE = @GCONF_SCHEMAS_INSTALL_TRUE@
GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@
GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@
GDU_MODULE_VERSION_CHECK_CFLAGS = @GDU_MODULE_VERSION_CHECK_CFLAGS@
GDU_MODULE_VERSION_CHECK_LIBS = @GDU_MODULE_VERSION_CHECK_LIBS@
GEDIT_CFLAGS = @GEDIT_CFLAGS@
GEDIT_LIBS = @GEDIT_LIBS@
GEDIT_MAJOR = @GEDIT_MAJOR@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
HELP_DIR = @HELP_DIR@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTOBJEXT = @INSTOBJEXT@
INTLLIBS = @INTLLIBS@
INTLTOOL_CAVES_RULE = @INTLTOOL_CAVES_RULE@
INTLTOOL_DESKTOP_RULE = @INTLTOOL_DESKTOP_RULE@
INTLTOOL_DIRECTORY_RULE = @INTLTOOL_DIRECTORY_RULE@
INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
INTLTOOL_ICONV = @INTLTOOL_ICONV@
INTLTOOL_KBD_RULE = @INTLTOOL_KBD_RULE@
INTLTOOL_KEYS_RULE = @INTLTOOL_KEYS_RULE@
INTLTOOL_MERGE = @INTLTOOL_MERGE@
INTLTOOL_MSGFMT = @INTLTOOL_MSGFMT@
INTLTOOL_MSGMERGE = @INTLTOOL_MSGMERGE@
INTLTOOL_OAF_RULE = @INTLTOOL_OAF_RULE@
INTLTOOL_PERL = @INTLTOOL_PERL@
INTLTOOL_PONG_RULE = @INTLTOOL_PONG_RULE@
INTLTOOL_PROP_RULE = @INTLTOOL_PROP_RULE@
INTLTOOL_SCHEMAS_RULE = @INTLTOOL_SCHEMAS_RULE@
INTLTOOL_SERVER_RULE = @INTLTOOL_SERVER_RULE@
INTLTOOL_SERVICE_RULE = @INTLTOOL_SERVICE_RULE@
INTLTOOL_SHEET_RULE = @INTLTOOL_SHEET_RULE@
INTLTOOL_SOUNDLIST_RULE = @INTLTOOL_SOUNDLIST_RULE@
INTLTOOL_THEME_RULE = @INTLTOOL_THEME_RULE@
INTLTOOL_UI_RULE = @INTLTOOL_UI_RULE@
INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
INTLTOOL_XAM_RULE = @INTLTOOL_XAM_RULE@
INTLTOOL_XGETTEXT = @INTLTOOL_XGETTEXT@
INTLTOOL_XML_NOMERGE_RULE = @INTLTOOL_XML_NOMERGE_RULE@
INTLTOOL_XML_RULE = @INTLTOOL_XML_RULE@
LDFLAGS = @LDFLAGS@
LIBBONOBO_IDL = @LIBBONOBO_IDL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
NO_STRICT_ALIASING_CFLAGS = @NO_STRICT_ALIASING_CFLAGS@
OBJEXT = @OBJEXT@
OMF_DIR = @OMF_DIR@
ORBIT_IDL = @ORBIT_IDL@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PLUGIN_LIBTOOL_FLAGS = @PLUGIN_LIBTOOL_FLAGS@
POFILES = @POFILES@
POSUB = @POSUB@
PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
PSPELL_LIBS = @PSPELL_LIBS@
PYGTK_CFLAGS = @PYGTK_CFLAGS@
PYGTK_CODEGEN = @PYGTK_CODEGEN@
PYGTK_DEFSDIR = @PYGTK_DEFSDIR@
PYGTK_H2DEF = @PYGTK_H2DEF@
PYGTK_LIBS = @PYGTK_LIBS@
PYTHON = @PYTHON@
PYTHON_CFLAGS = @PYTHON_CFLAGS@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@
PYTHON_INCLUDES = @PYTHON_INCLUDES@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_LIB_LOC = @PYTHON_LIB_LOC@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SPELL_PLUGIN_DIR = @SPELL_PLUGIN_DIR@
STRIP = @STRIP@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
WARN_CFLAGS = @WARN_CFLAGS@
XGETTEXT = @XGETTEXT@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pkgpyexecdir = @pkgpyexecdir@
pkgpythondir = @pkgpythondir@
prefix = @prefix@
program_transform_name = @program_transform_name@
pyexecdir = @pyexecdir@
pythondir = @pythondir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
# Python snippets plugin
plugindir = $(libdir)/gedit-2/plugins/snippets
plugin_PYTHON = \
__init__.py \
SnippetPluginInstance.py \
Snippet.py \
SnippetPlaceholders.py \
SnippetsDialog.py \
SnippetComplete.py \
functions.py
plugin_DATA = snippets.glade
EXTRA_DIST = snippets.glade
CLEANFILES = *.bak *.gladep
DISTCLEANFILES = *.bak *.gladep
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/snippets/snippets/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu plugins/snippets/snippets/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
install-pluginPYTHON: $(plugin_PYTHON)
@$(NORMAL_INSTALL)
test -z "$(plugindir)" || $(mkdir_p) "$(DESTDIR)$(plugindir)"
@list='$(plugin_PYTHON)'; dlist=''; for p in $$list; do\
if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
if test -f $$b$$p; then \
f=$(am__strip_dir) \
dlist="$$dlist $$f"; \
echo " $(pluginPYTHON_INSTALL) '$$b$$p' '$(DESTDIR)$(plugindir)/$$f'"; \
$(pluginPYTHON_INSTALL) "$$b$$p" "$(DESTDIR)$(plugindir)/$$f"; \
else :; fi; \
done; \
if test -n "$$dlist"; then \
if test -z "$(DESTDIR)"; then \
PYTHON=$(PYTHON) $(py_compile) --basedir "$(plugindir)" $$dlist; \
else \
PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir "$(plugindir)" $$dlist; \
fi; \
else :; fi
uninstall-pluginPYTHON:
@$(NORMAL_UNINSTALL)
@list='$(plugin_PYTHON)'; dlist=''; for p in $$list; do\
f=$(am__strip_dir) \
rm -f "$(DESTDIR)$(plugindir)/$$f"; \
rm -f "$(DESTDIR)$(plugindir)/$${f}c"; \
rm -f "$(DESTDIR)$(plugindir)/$${f}o"; \
done
install-pluginDATA: $(plugin_DATA)
@$(NORMAL_INSTALL)
test -z "$(plugindir)" || $(mkdir_p) "$(DESTDIR)$(plugindir)"
@list='$(plugin_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(pluginDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(plugindir)/$$f'"; \
$(pluginDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(plugindir)/$$f"; \
done
uninstall-pluginDATA:
@$(NORMAL_UNINSTALL)
@list='$(plugin_DATA)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(plugindir)/$$f'"; \
rm -f "$(DESTDIR)$(plugindir)/$$f"; \
done
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(DATA)
installdirs:
for dir in "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(plugindir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-pluginDATA install-pluginPYTHON
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-pluginDATA \
uninstall-pluginPYTHON
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-exec install-exec-am \
install-info install-info-am install-man install-pluginDATA \
install-pluginPYTHON install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-info-am uninstall-pluginDATA uninstall-pluginPYTHON
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
# Gedit snippets plugin
# Copyright (C) 2005-2006 Jesse van den Kieboom <jesse@icecrew.nl>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
from xml.dom import minidom
import xml
from SnippetPlaceholders import *
import os
from functions import *
class Snippet:
def __init__(self, node, plugin = None):
self.node = node
self.properties = {}
self.initSnippetData(plugin)
def initSnippetData(self, p):
props = {'tag': '', 'text': '', 'description': 'New snippet',
'accelerator': ''}
has_props = {}
for child in self.node.childNodes:
for prop in props:
if child.localName == prop:
has_props[prop] = child
if child.hasChildNodes():
self.properties[prop] = child.firstChild
if p:
for prop in props:
if not prop in has_props:
prop_node = p.xmldoc.createElement(prop)
self.node.appendChild(prop_node)
else:
prop_node = has_props[prop]
if not prop in self.properties:
text_node = p.xmldoc.createTextNode(props[prop])
self.properties[prop] = text_node
prop_node.appendChild(text_node)
if self.properties[prop].data == '':
self.properties[prop].data = props[prop]
def __getitem__(self, prop):
if prop in self.properties:
return self.properties[prop].data
return ''
def __setitem__(self, prop, value):
if prop in self.properties:
self.properties[prop].data = value
def display(self):
nm = markup_escape(self['description'])
tag = self['tag']
accel = self['accelerator']
detail = []
if tag:
detail.append(tag)
if accel:
detail.append(accel)
if not detail:
return nm
else:
return nm + ' (<b>' + markup_escape(str.join(', ', detail)) + \
'</b>)'
def add_placeholder(self, placeholders, placeholder):
if placeholders.has_key(placeholder.tabstop):
if placeholder.tabstop == -1:
placeholders[-1].append(placeholder)
else:
# This would be an error, really....
None
elif placeholder.tabstop == -1:
placeholders[-1] = [placeholder]
else:
placeholders[placeholder.tabstop] = placeholder
def updateLastInsert(self, view, index, lastInsert, text, mark, indent):
if index - lastInsert > 0:
buf = view.get_buffer()
piter = buf.get_iter_at_mark(mark)
lines = re.sub('\\\\(.)', '\\1', text[lastInsert:index]).split('\n')
if len(lines) == 1:
buf.insert(piter, lines[0])
else:
text = lines[0] + '\n'
for i in range(1, len(lines)):
text += indent + lines[i] + '\n'
buf.insert(piter, text[:-1])
lastInsert = index
return lastInsert
def substitute_environment(self, text, index, m):
# make sure indentation is preserved