[GRASS-dev] Re: [GRASSGUI] Re: [grass-addons] r659 - trunk/grassaddons/gui/gui_modules

Martin Landa landa.martin at gmail.com
Thu May 17 03:00:07 EDT 2007


Hi,

I am not quite sure if this patch OK...

-           self.module = subprocess.Popen(self.cmd, shell=True,
+           cmdList = cmd.split(' ')
+           self.module = subprocess.Popen(args=cmdList, shell=False,
                                           stdin=subprocess.PIPE,
                                           stdout=subprocess.PIPE,
                                           stderr=subprocess.PIPE,

Martin

2007/5/16, Michael Barton <michael.barton at asu.edu>:
> The good thing about using the command class is that if we get it right
> THERE, then it will be right throughout the GUI, and we won't have to change
> each instance that we call a GRASS command.
>
> This was the gist of my post. Martin is doing the cmd.py module and can fix
> it so that it doesn't use SHELL.
>
> Michael
>
>
> On 5/16/07 10:15 AM, "Martin Landa" <landa.martin at gmail.com> wrote:
>
> > Glynn,
> >
> > 2007/5/16, Glynn Clements <glynn at gclements.plus.com>:
> >
> >>> Are you thinking that we should change all calls to GRASS commands to use
> >>> the new cmd module?
> >>
> >>>> +        cmdString = "g.region -ugp region=%s" % wind
> >>
> >>>> +        p = cmd.Command (cmdString)
> >>
> >> This interface is broken, and needs to be replaced.
> >>
> >>            self.module = subprocess.Popen(self.cmd, shell=True,
> >>                                                     ^^^^^^^^^^
> >>
> >> Wrong. Wrong. Wrong. Wrong. Wrong. Wrong. Wrong. Wrong. Wrong.
> >>
> >> Just how clearly do I have to say this before it sinks in:
> >>
> >>         DO NOT USE THE SHELL
> >>
> >> Using the shell means problems with spaces, quotes and other shell
> >> metacharacters. There is no reason to use it. So don't.
> >
> > OK, then we need to fix Command class... (I will look at it tomorrow)
> >
> > Martin
> >
> >> --
> >> Glynn Clements <glynn at gclements.plus.com>
> >>
> >> _______________________________________________
> >> grassgui mailing list
> >> grassgui at grass.itc.it
> >> http://grass.itc.it/mailman/listinfo/grassgui
> >>
> >
>
> __________________________________________
> Michael Barton, Professor of Anthropology
> School of Human Evolution & Social Change
> Center for Social Dynamics and Complexity
> Arizona State University
>
> phone: 480-965-6213
> fax: 480-965-7671
> www: http://www.public.asu.edu/~cmbarton
>
>


-- 
Martin Landa <landa.martin at gmail.com> * http://gama.fsv.cvut.cz/~landa *




More information about the grass-gui mailing list