After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 461847 - python_loader plugin passes input and output objects as gobjects to python
python_loader plugin passes input and output objects as gobjects to python
Status: RESOLVED OBSOLETE
Product: Gnumeric
Classification: Applications
Component: import/export other
1.7.x
Other All
: Normal normal
: ---
Assigned To: Morten Welinder
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2007-07-30 15:55 UTC by Ignas Mikalajunas
Modified: 2018-05-22 13:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
plugin.xml (900 bytes, text/xml)
2007-09-09 20:28 UTC, Jon Kåre Hellan
Details
Python code for a file i/o plugin (705 bytes, text/x-python)
2007-09-09 20:29 UTC, Jon Kåre Hellan
Details

Description Ignas Mikalajunas 2007-07-30 15:55:06 UTC
There is no way to do anything with generic gobject objects in python, so you can't do any reading/writing in a python plugin. It used to be passing filenames, but now someone fixed it.

Fixing it to pass filenames would work, though i guess adding a pythonic wrapper for GfsOutput and GfsInput would be the right way.
Comment 1 Morten Welinder 2007-07-31 15:48:02 UTC
We can't use filenames anymore since input sources might not have filenames.

But it sounds like a GsfInput/GsfOutput would be a better choice.  And
that would match how methods are called.
Comment 2 Ignas Mikalajunas 2007-07-31 17:02:12 UTC
It seems that GsfOutput and GsfInput objects are not a part of gnumeric. So I am wondering whether having the API in gnumeric code instead libgsf is workable?
Comment 3 Jon Kåre Hellan 2007-09-09 20:26:51 UTC
There are python bindings for libgsf as well, and as of libgsf 1.14.2, they are built by default. If your distribution has them, you can do e.g.

  import gsf

  output.write(len(str), str)

or

  t=gsf.InputTextline(input)
  # Read input line by line
  while 1:
    s = t.utf8_gets()
    if not s:
        break
    print s

I'm attaching .py and plugin.xml for a plugin which reads and saves /etc/passwd style files.
Comment 4 Jon Kåre Hellan 2007-09-09 20:28:24 UTC
Created attachment 95225 [details]
plugin.xml
Comment 5 Jon Kåre Hellan 2007-09-09 20:29:04 UTC
Created attachment 95226 [details]
Python code for a file i/o plugin
Comment 6 GNOME Infrastructure Team 2018-05-22 13:21:59 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnumeric/issues/79.