cls.runModule('g.remove', flags='f', type='rast3d',
pattern=','.join(['map_1', 'map_2', 'map_3', 'map_4', 'map_5',
'test_flowaccum']))

should work. I think now we see a new challenge with separate type and map
name options. In GUI, how should we list map names for the pattern option?

1. Select map types first
2. List only those maps based on the selected map types.

It looks like we need some python tricks for g.remove GUI?

-- 
Huidae



On Tue, Sep 30, 2014 at 11:30 AM, Vaclav Petras <wenzesl...@gmail.com>
wrote:

>
>
> On Fri, Sep 26, 2014 at 6:53 AM, Huidae Cho <gras...@gmail.com> wrote:
>
>> Markus,
>>
>> It has to be a single parameter because of commas in a pattern. Multiple
>> map names are handled as a pattern internally e.g. map1,map2 => {map1,map2}.
>>
> Then of course, PyGRASS has no chance to know that and the recent type
> enforcement addition will force you to use string instead of a list
>
> cls.runModule('g.remove', flags='f', type='rast3d', pattern=['map_1',
> 'map_2', 'map_3', 'map_4', 'map_5', 'test_flowaccum'])
> ...
> TypeError: The Parameter <pattern> does not accept multiple inputs
>
>
> http://fatra.cnr.ncsu.edu/grassgistests/reports_for_date-2014-09-30-07-00/report_for_nc_spm_08_grass7_nc/raster3d/r3.flow/r3flow_test/index.html
>
> (This test ends with error, PyGRASS is used internally.)
>
> I don't know what to do about it besides stating that it how it is or
> relaxing the type checks in PyGRASS. Adding some info to the option like
> "behaves as multiple=YES" seem too complicated.
>
> Vaclav
>
>> Regards,
>> Huidae
>> On Sep 26, 2014 5:48 AM, "Markus Neteler" <nete...@osgeo.org> wrote:
>>
>>> Hi Huidae,
>>>
>>> On Thu, Sep 25, 2014 at 6:20 PM, Huidae Cho <gras...@gmail.com> wrote:
>>> > Markus,
>>> >
>>> > Currently, g.remove supports "g.remove vect pattern=map1,map2".
>>> Pattern can
>>> > take multiple map names separated by a comma.
>>>
>>> ok, good. Perhaps I got just confused because the help text does not
>>> show this yet:
>>>
>>> current:
>>>  g.remove [-refb] type=datatype[,datatype,...] pattern=string
>>>  ...
>>>
>>> expected:
>>>  g.remove [-refb] type=datatype[,datatype,...]
>>> pattern=string[,string,...]
>>> ...
>>>
>>> It would be multiple = YES for pattern to have that but I don't know
>>> if any other changes might be required then.
>>>
>>> Best
>>> Markus
>>>
>>
>
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to