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

run batch from python scheduled via lanchd OS X

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.

3 of 3 messages available
Toggle history

Please log in to manage your subscriptions.

run batch from python scheduled via lanchd OS X heathcarlisle 09 Dec 01:11
run batch from python scheduled via lanchd OS X Omari Stephens 10 Dec 10:03
  run batch from python scheduled via lanchd OS X heathcarlisle 15 Dec 17:53
2009-12-09 01:11:21 UTC (almost 15 years ago)
postings
2

run batch from python scheduled via lanchd OS X

Greeting: interesting scenario:

I have a number of batch workflows, written in python, that run as python-fu plugins.

Sample bash terminal command:

gimp -ibdf '(python-fu-batch-colorRT RUN-NONINTERACTIVE \"*.JPG\")''(gimp-quit 1)'

Opens each file and applies the plug in. Works Fine.

Also fine when run from a wrapping python script as:

command = "gimp -ibdf '(python-fu-batch-usnaps-colorRT RUN-NONINTERACTIVE \"*.JPG\")''(gimp-quit 1)'"

process = Popen([command], shell=True)

..PROVIDED that the wrapping script is run from the bash command line:

./doColorRT

Problem is, when this same python wrapping script is scheduled via launchd,(OS X launch daemon) an error is generated "sh: gimp: command not found" and gimp never runs.

I can replace the entire gimp command with a common shell command (ls, whoami, etc for example) and I get the proper response from either run method.

The wrapper script runs based on launchd's key, as new images arrive in a folder.

Anyone use this type of workflow? Help is greatly appreciated,

kindly, -hc

Omari Stephens
2009-12-10 10:03:58 UTC (almost 15 years ago)

run batch from python scheduled via lanchd OS X

launchd likely uses a sanitized environment where gimp is no longer in the PATH. Try adding the directory with gimp to PATH as the first step in your wrapper script.

--xsdg

Heath Carlisle escribió:

Greeting: interesting scenario:

I have a number of batch workflows, written in python, that run as python-fu plugins.

Sample bash terminal command:

gimp -ibdf '(python-fu-batch-colorRT RUN-NONINTERACTIVE \"*.JPG\")''(gimp-quit 1)'

Opens each file and applies the plug in. Works Fine.

Also fine when run from a wrapping python script as:

command = "gimp -ibdf '(python-fu-batch-usnaps-colorRT RUN-NONINTERACTIVE \"*.JPG\")''(gimp-quit 1)'"

process = Popen([command], shell=True)

..PROVIDED that the wrapping script is run from the bash command line:

./doColorRT

Problem is, when this same python wrapping script is scheduled via launchd,(OS X launch daemon) an error is generated "sh: gimp: command not found" and gimp never runs.

I can replace the entire gimp command with a common shell command (ls, whoami, etc for example) and I get the proper response from either run method.

The wrapper script runs based on launchd's key, as new images arrive in a folder.

Anyone use this type of workflow? Help is greatly appreciated,

kindly, -hc

2009-12-15 17:53:57 UTC (almost 15 years ago)
postings
2

run batch from python scheduled via lanchd OS X

Thanks for the response. That does seem to be the case: I can query the environment variables from within the python wrapper and I do get an abbreviated list when the wrapper is called from launchd.

I can configure the plist to alter the environment for the wrapper job, but that seems to be an extremely combersome mehod.

For instance, if I add the path and successfully call GIMP, I get errors further down the dependency chain..

There are also a bunch of environment variables in /tmp/ that I can't hard wire into a plist.

thanks again! -hc

launchd likely uses a sanitized environment where gimp is no longer in the

PATH. Try adding the directory with gimp to PATH as the first step in your wrapper script.

--xsdg

Heath Carlisle escribio:

Greeting: interesting scenario:

I have a number of batch workflows, written in python, that run as

python-fu plugins.

Sample bash terminal command:

gimp -ibdf '(python-fu-batch-colorRT RUN-NONINTERACTIVE

\"*.JPG\")''(gimp-quit 1)'

Opens each file and applies the plug in. Works Fine.

Also fine when run from a wrapping python script as:

command = "gimp -ibdf '(python-fu-batch-usnaps-colorRT RUN-NONINTERACTIVE

\"*.JPG\")''(gimp-quit 1)'"

process = Popen([command], shell=True)

..PROVIDED that the wrapping script is run from the bash command line:

./doColorRT

Problem is, when this same python wrapping script is scheduled via

launchd,(OS X launch daemon) an error is generated "sh: gimp: command not found" and gimp never runs.

I can replace the entire gimp command with a common shell command (ls,

whoami, etc for example) and I get the proper response from either run method.

The wrapper script runs based on launchd's key, as new images

arrive in a folder.

Anyone use this type of workflow? Help is greatly appreciated,

kindly, -hc