Problem writing python-fu (GIMP) scripts


#1

I am unable to use Atom to author/create python-fu scripts for GIMP. It isn’t an issue with the script. E.g. I create a new python document using Atom, paste some content that I know to be good, and re-save the file in the correct directory. However, when I fire up GIMP the file/script is not found. I do the same thing, using TextWrangler, paste the content as before, and again save it (in the same location), it works! GIMP finds the file, and will execute the same.

Can anyone suggest what is going on here?

Thanks.

-u


#2

If GIMP cannot see that the file even exists, I’m not sure that is something that doing something differently in Atom can help with. If GIMP can see the file, attempt to load it and something goes wrong … that might be something that Atom would be able to affect.

Can you give an example of what steps you go through, what you expected to happen and what actually happened?


#3

I have described the steps above as best I can. I am not sure what further information I can give, I hope this may help.

I have a script named flick_me.py, which GIMP runs from a menu command. It doesn’t do much except print a message to the GIMP message dialogue. It works!

I open the file in Atom, copy its content to the clipboard, and then delete the file, and remove the file from the Atom buffer. I create a new file named flick_me.py, same location, paste the content into the new file, save it, and boot up GIMP, but the plug-in is now missing!

I close GIMP, trash the Atom file, put the old file back, boot GIMP, and the plug-in is restored, or I can create a fresh file named flick_me.py in TextWrangle, paste the clipboard content to the file and save it, boot up GIMP and the plug-in is back where it ought to be and there are no issues.

Thanks

-u


#4

It sounds like there might be an encoding issue. GIMP may expect a text encoding other than UTF-8 and just doesn’t do anything if it can’t parse the file. You may want to contact the GIMP Python folks and see if there is an encoding requirement.


#5

I have tried other encodings - TextWranlger is also set to UTF-8. I have posted a query to GIMP users.

It is a mystery!


#6

I found this here http://wiki.gimp.org/wiki/Hacking:Plugins:

Scheme and Python plug-ins are readable text files. C-language and Python plug-in files must have permissions set to allow execution.

Not, sure if it is relevant.


#7

That sounds like it could be the reason.


#8

Seems to be. AFAIK, this is done automatically in TextWrangler, provided the file contains a shebang. Is there a reason why Atom does not do this?

Thanks.