Re: Patch: export more methods to python



Hi Anatoly,

If you are using 1.12.x, you might also imprt the Gnm module from the
gogject intreospection repository. That would give you access to many
more functionalities (though the naming conventions in Gnumeric are not
always optimal and make introspection do stupid things).

from gi.repositiory import Gnm

Regards,
Jean

Le jeudi 31 octobre 2013 à 23:47 +0200, Anatoly Asviyan a écrit :
Hello,

I needed some functionality exported to python from gnumeric for
a personal project, and it looks to me like something that might
be useful to others too.  Thus, here's the patch.

It adds the following methods to the python "Sheet" object:
* insert row
* delete row


and the following ones to the python "GUI" object:
* get sheet (current sheet)
* get cursor (active cell in a current sheet)


Now, it's possible to do something like this:

def insert_row(gui):
    s = gui.get_sheet()
    pos = gui.get_cursor()
    s.insert_row(pos.row)

The patch is here
http://sourceforge.net/p/fborg/code/HEAD/tree/gnumeric/py-api-1.patch



-- 
Regards, Anatoly
_______________________________________________
gnumeric-list mailing list
gnumeric-list gnome org
https://mail.gnome.org/mailman/listinfo/gnumeric-list




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