Re: [Gimp-developer] Problem with python save handler

2012-09-10 Thread Rob Antonishen
On Mon, Sep 10, 2012 at 11:12 AM, Joao S. O. Bueno wrote:
> On 9 September 2012 17:09, Rob Antonishen  wrote:
 It seems the issue is related to adding extra parameters to the save 
 handler

 Is it not possible to have dialog parameters with a python save handler?
>>>
>>> Seems not, no.  Setting the menu="" and/or setting the on_query
>>> causes your extra float parameters to always be set to "0.0", and
>>> there's no dialog. I can't tell if that's a bug, or by design.
>>>
> The openraster import/export plug-in ships with GIMP and should
> be used as an example to take off any doubts.
>

Thanks Joao-

I had looked at the ora handler as an example, but it does not use any
additional parameters on the save.

-Rob A>
___
gimp-developer-list mailing list
gimp-developer-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gimp-developer-list


Re: [Gimp-developer] Problem with python save handler

2012-09-10 Thread Joao S. O. Bueno
On 9 September 2012 17:09, Rob Antonishen  wrote:
>>> It seems the issue is related to adding extra parameters to the save 
>>> handler
>>>
>>> Is it not possible to have dialog parameters with a python save handler?
>>
>> Seems not, no.  Setting the menu="" and/or setting the on_query
>> causes your extra float parameters to always be set to "0.0", and
>> there's no dialog. I can't tell if that's a bug, or by design.
>>
>> This is a quick and dirty hack, but seems to work:
>> http://pastebin.com/g1kriiqf
>>
>> It ends up at the bottom of the File menu, instead of being properly
>> registered as a save handler.

The openraster import/export plug-in ships with GIMP and should
be used as an example to take off any doubts.

Check the code at:
http://git.gnome.org/browse/gimp/tree/plug-ins/pygimp/plug-ins/file-openraster.py

(If, on the other hand, openraster import/export itself is not
working, than something is broken, and we will have to fix it)


   js
  -><-


>>
>
> Thanks Chris-
>
> I'll just set the scaling to be 0-100 and let users deal with the
> scaling in the receiving application.
>
> The odd thing is that I did manage to get a dialog showing up on the
> first save, then not on subsequent, the it stopped working completely,
> so I'm guessing there is a bug in there somewhere.
>
> -Rob A>
> ___
> gimp-developer-list mailing list
> gimp-developer-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gimp-developer-list
___
gimp-developer-list mailing list
gimp-developer-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gimp-developer-list


Re: [Gimp-developer] Problem with python save handler

2012-09-09 Thread Chris Mohler
Another workaround might be to pop up your own gtk window.  There's a
plug-in in the registry called "unseparate PNGS" that opens its own gtk
dialog.

Chris
On Sep 9, 2012 3:10 PM, "Rob Antonishen"  wrote:

> >> It seems the issue is related to adding extra parameters to the save
> handler
> >>
> >> Is it not possible to have dialog parameters with a python save handler?
> >
> > Seems not, no.  Setting the menu="" and/or setting the on_query
> > causes your extra float parameters to always be set to "0.0", and
> > there's no dialog. I can't tell if that's a bug, or by design.
> >
> > This is a quick and dirty hack, but seems to work:
> > http://pastebin.com/g1kriiqf
> >
> > It ends up at the bottom of the File menu, instead of being properly
> > registered as a save handler.
> >
>
> Thanks Chris-
>
> I'll just set the scaling to be 0-100 and let users deal with the
> scaling in the receiving application.
>
> The odd thing is that I did manage to get a dialog showing up on the
> first save, then not on subsequent, the it stopped working completely,
> so I'm guessing there is a bug in there somewhere.
>
> -Rob A>
>
___
gimp-developer-list mailing list
gimp-developer-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gimp-developer-list


Re: [Gimp-developer] Problem with python save handler

2012-09-09 Thread Rob Antonishen
>> It seems the issue is related to adding extra parameters to the save 
>> handler
>>
>> Is it not possible to have dialog parameters with a python save handler?
>
> Seems not, no.  Setting the menu="" and/or setting the on_query
> causes your extra float parameters to always be set to "0.0", and
> there's no dialog. I can't tell if that's a bug, or by design.
>
> This is a quick and dirty hack, but seems to work:
> http://pastebin.com/g1kriiqf
>
> It ends up at the bottom of the File menu, instead of being properly
> registered as a save handler.
>

Thanks Chris-

I'll just set the scaling to be 0-100 and let users deal with the
scaling in the receiving application.

The odd thing is that I did manage to get a dialog showing up on the
first save, then not on subsequent, the it stopped working completely,
so I'm guessing there is a bug in there somewhere.

-Rob A>
___
gimp-developer-list mailing list
gimp-developer-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gimp-developer-list


Re: [Gimp-developer] Problem with python save handler

2012-09-09 Thread Chris Mohler
On Sun, Sep 9, 2012 at 10:00 AM, Rob Antonishen
 wrote:
> It seems the issue is related to adding extra parameters to the save 
> handler
>
> Is it not possible to have dialog parameters with a python save handler?

Seems not, no.  Setting the menu="" and/or setting the on_query
causes your extra float parameters to always be set to "0.0", and
there's no dialog. I can't tell if that's a bug, or by design.

This is a quick and dirty hack, but seems to work:
http://pastebin.com/g1kriiqf

It ends up at the bottom of the File menu, instead of being properly
registered as a save handler.

Chris
___
gimp-developer-list mailing list
gimp-developer-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gimp-developer-list


Re: [Gimp-developer] Problem with python save handler

2012-09-09 Thread Rob Antonishen
It seems the issue is related to adding extra parameters to the save handler

Is it not possible to have dialog parameters with a python save handler?

-Rob A>

On Sat, Sep 8, 2012 at 12:48 PM, Rob Antonishen
 wrote:
>>
>> Dunno if it's related but "min" and "max" are built-in functions, so
>> you shouldn't use them for var names.
>>
>> Chris
>
> Thanks I caught that and changed it, but still no luck
> http://pastebin.com/MKUEshcx
>
> -Rob A>
___
gimp-developer-list mailing list
gimp-developer-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gimp-developer-list


Re: [Gimp-developer] Problem with python save handler

2012-09-08 Thread Rob Antonishen
>
> Dunno if it's related but "min" and "max" are built-in functions, so
> you shouldn't use them for var names.
>
> Chris

Thanks I caught that and changed it, but still no luck
http://pastebin.com/MKUEshcx

-Rob A>
___
gimp-developer-list mailing list
gimp-developer-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gimp-developer-list


Re: [Gimp-developer] Problem with python save handler

2012-09-08 Thread Chris Mohler
On Sat, Sep 8, 2012 at 10:31 AM, Rob Antonishen
 wrote:
> Can anyone suggest what dumb mistake I've made?

Dunno if it's related but "min" and "max" are built-in functions, so
you shouldn't use them for var names.

Chris
___
gimp-developer-list mailing list
gimp-developer-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gimp-developer-list


[Gimp-developer] Problem with python save handler

2012-09-08 Thread Rob Antonishen
I've put together a simple python save handler for OpenSCAD surface files.

It was working, but after making some changes it is no longer popping
up a dialog and is failing to save.  I can, however call it via the
python console like  pdb.file_openscad_save

The code is here:
http://pastebin.com/EmpxmFVb

I am a python newb, so I suspect it might have something to do with
bad syntax, but I get no errors when gimp starts up

Can anyone suggest what dumb mistake I've made?

Thanks,

-Rob A>
___
gimp-developer-list mailing list
gimp-developer-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gimp-developer-list