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

Michael Barton michael.barton at asu.edu
Sun Mar 25 01:12:14 EDT 2007


I can't remember the exact error, but it said essentially that "PIPE" is not
a valid parameter. This could be a bug in the Mac version, of course. But it
would be nice to see if it works on another platform before I report it, in
case I've just forgotten some punctuation, capitalization, or something.

Michael


On 3/24/07 8:12 PM, "Glynn Clements" <glynn at gclements.plus.com> wrote:

> 
> Michael Barton wrote:
> 
>>> 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.
>> 
>> I'd tried to use Popen at one point (still commented out) in the command
>> parser in gismutil.py. I never was able to get it to recognize the PIPE
>> argument. I probably specified it wrong, but I could never find out how to
>> get it right.
> 
> What do you mean by "recognize"?
> 
> The call looks okay, except that
> 
>             self.out = subprocess.Popen(cmd, shell=True, stdout=PIPE).stdout
> 
> is assigning a stream to self.out while the existing call:
> 
>             self.out = os.popen(cmd, "r").read()
> 
> is assigning a string. The former will cause the line:
> 
>             self.cmd_output.write(self.out+"\n")
> 
> to fail, as self.out won't be a string.

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton





More information about the grass-gui mailing list