Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python-fu: Exiting properly in batche mod with Gimp 2.99
#1
Greetings.

I should first mention that this problem has to do with the new API.
Due to certain constraints, I have to use python 3, and so I've been using Gimp 2.99.

https://www.gimp-forum.net/Thread-What-i...-batch-job

I've tried to adapt the method shown in the thread above for python3, adding a Gimp.quit() at the end of the do_it function.

This is the command I'm using.

Code:
gimp-console-2.99  -idf --batch-interpreter python-fu-eval -b "import sys;sys.path=['.']+sys.path;import backrem;backrem.do_it()"

This is the message I get.


Code:
plug-in 'python-eval.py' aborted before sending its procedure return values
batch command experienced a calling error:
Procedure 'python-fu-eval' returned no return values

Other information:
  1. If I remove 'Gimp.quit()' from the actual script and add '-b "Gimp.quit()"' to the command, I still get an error.
  2. If I remove it from both the script and the command, the process does not terminate.

(I'm aware that this isn't code, but I couldn't find the appropriate BBCode tags)
Reply
#2
Tried to put the gimp.quit() after backrem.do_it() ?
Reply
#3
(07-24-2021, 06:57 AM)Ofnuts Wrote: Tried to put the gimp.quit() after backrem.do_it() ?

Thank you for the reply!

I tried it after you suggested it. It doesn't seem to improve anything. Still the same error.

Additional info: My code is only a script, it's not a plugin per se. I haven't implemented do_query_procedures and do_create_procedure (according to https://wiki.gimp.org/wiki/Hacking:Plugins_v3).
Reply
#4
I have found a solution. I was stupid to have overlooked it.

Since it was pdb.gimp_quit() for the old version, for this one, it will naturally be

Gimp.get_pdb().run_procedure('gimp-quit', [True]).

However, it seems to cause memory leaks.
Reply


Forum Jump: