using a parasite in a python import/export script

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

 



Hello,

If this is the wrong list for my question, please tell me the right place for it.

I wrote an exporter script (to a new file format) in python. This script requires the user to choose the location of some other file, amongst other settings before saving the image
so in the call to the register function, there is the following:
        (PF_BOOL,  "compression", _("Use _compression (LZO, not yet implemented)"), True),
        (PF_FILE,  "ftsarc", _("The ftsarc binary"), "/some/path/to/some/file")

Once the user selected that file, I would like to keep that setting in mind to avoid him the need to re-select it, as it is very likely to never change. I could do this by saving it into a well-defined file, like ~/.something, but that sucks (I don't like to pollute the filesystem).

I found that the png exporter plugin uses "parasites" for this, that sounds interesting. Now, trying to read my parasite is a problem, I need to read it before the call to register but at that time, the GIMP system doesn't seem to be ready yet. Just doing:
        print gimp.parasite_list()
in the script will print out the error:
        LibGimpBase-ERROR **: gimp_wire_write_msg: the wire protocol has not been initialized
        aborting...
        (gimp:17350): LibGimpBase-WARNING **: gimp: gimp_wire_read(): error
to the console.

Is there any other way to achieve what I want? (Without saving it to a well-defined file in the user's home)

--
Regards, Lucas
http://arkana-fts.sourceforge.net
_______________________________________________
Gimp-developer mailing list
Gimp-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux