[GRASSGUI] initiating d.* command dialogs with existing parameters

Glynn Clements glynn at gclements.plus.com
Sat Mar 24 21:21:32 EDT 2007


Michael Barton wrote:

> I¹ve set up a  structure (in gisutils and menuform) to pass command
> parameters from an existing layer in the GIS Manager to the options dialog
> when it is opened. We still need to parse existing d.* command in gismutils
> to do this (and of course debug in menuform). This will work much easier if
> a command is created as a list instead of a string. Glynn suggested this,
> but there were some questions/concerns from Jachym about using spawn. I¹ll
> hold off on finishing this until we get it settled about parsing a command
> as a string or list.

Parsing or passing?

If we're willing to accept a requirement of Python 2.4 or later, then
it appears that the subprocess module (the Popen class and the call
convenience function) is the preferred interface.

It seems to cover all of the required cases, doesn't use a shell
unless explicitly told to, and appears to implement all relevant
functionality on both Unix and Windows.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-gui mailing list