Commit 8d0d5fc3 authored by Chyla Zbigniew's avatar Chyla Zbigniew
Browse files

New plugin, sample Python functions.

*, plugin.xml,
New plugin, sample Python functions.
parent 6bb98b3e
2001-03-05 Zbigniew Chyla <>
*, plugin.xml,
New plugin, sample Python functions.
gnumeric_plugin_py_funcdir = $(gnumeric_plugindir)/py-func
gnumeric_plugin_py_func_DATA = plugin.xml
gnumeric_plugin_py_func_SCRIPTS =
EXTRA_DIST = $(gnumeric_plugin_py_func_DATA)
<?xml version="1.0"?>
<plugin id="Gnumeric_PyFunc">
<information name="Python functions" description="Sample Python plugin providing some (useless) functions."/>
<loader type="python">
<attribute name="module_name" value="py_func"/>
<service type="file_opener" id="pot" priority="1" probe="FALSE">
<information description="PO/POT files import"/>
<file_pattern type="shell_pattern" value="*.po"/>
<file_pattern type="shell_pattern" value="*.pot"/>
<save_info saver_id="" format_level="manual_remember"/>
<service type="function_group" id="test">
<category name="Python"/>
<function name="py_printf"/>
<function name="py_capwords"/>
from Gnumeric import *
import string
def func_printf(format, *args):
'@SYNTAX=PY_PRINTF (format,...)\n'\
'PY_PRINTF("Test: %.2f",12) equals "Test: 12.00")'\
val = format % args
except TypeError:
raise GnumericError, GnumericErrorVALUE
return val
def func_capwords(str):
'@SYNTAX=PY_CAPWORDS (string)\n'\
'PY_CAPWORDS("Hello world") equals "Hello World")'\
return string.capwords(str)
test_functions = {
'py_printf': func_printf,
'py_capwords': ('s', 'string', func_capwords)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment