Re: gobject-introspection for Gnumeric [Was: Python headers for pygobject 3/Gnumeric 1.12.25]



I don't know for Ruby, but with Python, you can do something like:

$ python
import gi
gi.require_version('GOffice','0.10')
from gi.repository import GOffice
gi.require_version('Gnm', '1.12')
from gi.repository import Gnm
Gnm.init()
wb=Gnm.Workbook.new_with_sheets(1)
sheet=wb.sheet_by_index(0)
cell=sheet.cell_create(0,0)
cell.set_text('Hello World!')
cc=Gnm.CmdContextStderr.new()
uri='file:///home/jean/MyWb.gnumeric'
fs=GOffice.FileSaver.for_file_name(uri)
wv=Gnm.WorkbookView.new(wb)
Gnm.wb_view_save_as(wv,fs,uri,cc)

Due to poor naming conventions in gnumeric, the last line is not
wv.save_as(fs,uri,cc)

That will have to be enhanced in next version.

Hope this helps,

Jean

Le dimanche 01 novembre 2015 à 15:03 +0100, Michael Uplawski a écrit :
It's me again. Now on GObject

On Fri, Oct 30, 2015 at 03:10:15PM +0100, Jean Brefort wrote:
Note that gnumeric scripting is available through gobject-
introspection
for many languages such as javascript, python (2.7 only for now),
and
others. I suppose ruby is part of the list.
I think that we have most of which would be needed to implement
macros
(using the same languages).

The information which is available on the Web does not help to enter
this new world, let alone to find your way. I am even unsure what
they
are dealing on those pages and in those documents. If they explain
how
language bindings are created by use of GObject-Inspection, thank
you. I
am not interested.

Let's forget all that. Where or how can I obtain a list of objects,
that
I can address in code, while a Gnumeric session is running, and in an
effort to manipulate ... “things” (let's say cell-values and the
like)
*in that very running Gnumeric-Session*. Jean called that macros, but
I
am not sure that everybody has the same understanding of macros.

I can require the Ruby-module or the Ruby-modules which are provided
for
GObject-Inspection. What I lack is any knowledge of how I get in
touch
with Gnumeric. If this is too basic and needs too much words to
explain,
say so, too. It would just confirm my initial impression and make me
hope for a working Python-Plugin in the future.

Thanks for all you do, anyway.

Michael




Le vendredi 30 octobre 2015 à 13:35 +0100, Michael Uplawski a
écrit :
Good afternoon.

On Fri, Oct 30, 2015 at 09:59:30AM +0100, Jean Brefort wrote:
I suppose you need python-dev. Note that gnumeric does not
support
Python-3 for now.

And that would be it. After some attempts to provide needed
dependencies, a simply missing Python-3 support is the best hint
of
all,
for now.

I may opt for a parallel installation of two Gnumeric versions.
More background: I am a fierce adept of the SoftMaker Office-
Suite
(non-free, commercial, closed source and all.., but some
attributes
that
you have to experience, see, hear and do yourself to understand).

Automation/scripting is available only in their Windows-release
and
only
by means of OLE and yet another Basic-variant. Gnumeric has other
advantages, too; that is why I am completely “undecided” as to
which
program to use.

If Python worked or if any other scripting-language (I mean Ruby)
could
be used to automate any spreadsheets that are *not* Excel, all
were
clear. For the time, neither the spreadsheet-programs nor the
scripting
interfaces provided for different languages satisfy me.

Just go ahead with the plugin-interface and it will be great. ;-)

TIA,

Michael


_______________________________________________
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]