[Qgis-developer] external programs in QGIS and plugins need configurable location

William Kyngesburye woklist at kyngchaos.com
Wed Apr 21 20:12:17 EDT 2010


On Apr 21, 2010, at 6:01 PM, Barry Rowlingson wrote:

> On Wed, Apr 21, 2010 at 8:48 PM, William Kyngesburye
> <woklist at kyngchaos.com> wrote:
>> Kind of a bug/feature request for plugins in general, though it was brought to my attention for the GDAL tools plugin.
>> 
>> At least on OS X (maybe Windows?) applications (the GUI, bundle type, like Qgis) do not get anything from the shell environment, like the PATH.  For any use of external CLI programs, applications will fail to find them in the PATH as would happen when run from the Terminal.  There is one "official" way, but it's not well documented (if at all) or known, and is still clunky and un-Mac-like.
>> 
>> Plugins that use external programs, ie GDAL Tools using the GDAL programs, need a configuration option to set and save the path to those programs.
>> 
> 
> So although a properly set PATH exists on both these platforms it
> seems to not be passed through to applications that might want to make
> use of it? Seems dumb to expect any application that is going to
> launch executables to have to keep record of paths and rig up a dialog
> to let the user change it... Operating Systems are supposed to sort
> this out for us...
> 
> Is this for executables launched via Qt (using maybe QProcess) and/or
> things launched with the usual C++ or Python launch codes?

This is the way OS X works.  Applications do not run from a shell, thus don't load any shell init files.

The environment still exists, and PATH and other items can be set and used by the application.  Non-OS-specific methods of starting programs from within an application should behave as expected, but when inheriting environment they'd be inheriting only what the app knows, unless you can tell it to init from a shell (I don't know all the exec's and popen's enough to know if this is possible).

Even if getting the shell environment is possible in some way for the application, or for processes started by the application, OS X (and Windows?) users generally don't want to muck around with editing .profiles (sure, us GIS folk are tech geeks, for now), but want a GUI to configure an option via a folder selection dialog.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

All generalizations are dangerous, even this one.




More information about the Qgis-developer mailing list