Re: user defined functions in Python



On 06/20/2005 09:30 PM, Charles R. Twardy wrote:
Hi Luiz,

The "Extending Python" chapter should cover this. It has a section with:

<<
   1. Make the directories
         1. mkdir ~/.gnumeric
         2. mkdir ~/.gnumeric/<version>
   2. mkdir ~/.gnumeric/<version>/myfuncs/
   3. cd ~/.gnumeric/<version>/myfuncs/

Make the files

A spellbook has two files. The first is the python file with the functions. The second is the XML file "plugin.xml". The XML file holds that master spells that tell Gnumeric what functions we've defined, and what the name of the python file is, and one other important item. We'll create these as blank files.

   1. touch my-func.py
   2. touch plugin.xml
...

I followed instructions on:

http://www.gnome.org/projects/gnumeric/doc/sect-extending-python-writing.htm

However, I put the files in ~/.gnumeric/<version>/plugins/myfuncs/

instead because that's more similar to the way it's done in:

  /usr/lib/gnumeric/<version>/plugins/

Anyway, it seemed to work because selecting:

  Tools|plug-ins...|directories

showed:

  /usr/lib/gnumeric/1.6.1/plugins
  <my-home>/.gnumeric/1.6.1/plugins
  /usr/lib/goffice/0.1.2/plugins

However, the Plugin directory: field at:

  Tools|plug-ins...|Plugin Details

wouldn't show any input despite typing in the field.  Should it?

Also, when I selected the f(x) (i.e. Edit a function in current cell),
then the Category, Local Python, and then the sole entry, py_add,
the Description showed:

  Incorrect Function Description.

  Incorrect Function Description.

The same showed with Category, Python, was selected and any entry
was selected.  Should this be a bug?




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]