RSS/Atom feed Twitter
Site is read-only, email is disabled

Improving pygimp documentation

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

Improving pygimp documentation Sean Munkel 30 Mar 02:01
  Improving pygimp documentation Joao S. O. Bueno 30 Mar 11:33
Sean Munkel
2013-03-30 02:01:22 UTC (over 11 years ago)

Improving pygimp documentation

After picking this up again I've run into a problem. I'm not really sure how to get this to replace the current gimp.PDB with its wrapped version. Am I correct in thinking that the best way to do this is to rename the gimp.so C library to be _gimp.so and then importing everything from there in a python file gimp.py and do the wrapping step in there?

On Wed, Mar 6, 2013 at 10:47 PM, Sean Munkel wrote:

One
way to get around this issue of __doc__ not being display is to actually create a regular python function for each procedure. Instead of using gimp.PDB you would have to wrap it in a class that will use its methods but hook into __getattr__. Inside of __getattr__ it would create a function that would then be able to have a __doc__ that would be displayed by help.

https://gist.github.com/smunkel/5103533

Yes - that would be more or less the way to go - Or that, or make each PDB callable object be in a separate class by

itself.

Did the code in the link above work for you? (I have not tried it yet)

It isn't properly dealing with Nones everywhere yet, but for the most part its
working correctly.

--Sean Munkel

Joao S. O. Bueno
2013-03-30 11:33:05 UTC (over 11 years ago)

Improving pygimp documentation

On 29 March 2013 23:01, Sean Munkel wrote:

After picking this up again I've run into a problem. I'm not really sure how to get this to replace the current gimp.PDB with its wrapped version. Am I correct in thinking that the best way to do this is to rename the gimp.so C library to be _gimp.so and then importing everything from there in a python file gimp.py and do the wrapping step in there?

It would be the "correct thing to do"- but in the process of doing so, I like to offload as much of the hard-coded C bindings in there to Python itself - as there is some proof of concept in the Summer of Code Python branch.

And...doing so, would also imply in having to put tests in place for that stuff -
that should definitely come first.

js ->

On Wed, Mar 6, 2013 at 10:47 PM, Sean Munkel wrote:

One
way to get around this issue of __doc__ not being display is to actually create a regular python function for each procedure. Instead of using gimp.PDB you would have to wrap it in a class that will use its methods but hook into __getattr__. Inside of __getattr__ it would create a function that would then be able to have a __doc__ that would be displayed by help.

https://gist.github.com/smunkel/5103533

Yes - that would be more or less the way to go - Or that, or make each PDB callable object be in a separate class by itself.

Did the code in the link above work for you? (I have not tried it yet)

It isn't properly dealing with Nones everywhere yet, but for the most part its
working correctly.

--Sean Munkel

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