[GRASS-dev] What is the status of g.list, g.remove, g.mlist and g.mremove?

Vaclav Petras wenzeslaus at gmail.com
Tue Sep 30 08:30:49 PDT 2014


On Fri, Sep 26, 2014 at 6:53 AM, Huidae Cho <grass4u at 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" <neteler at osgeo.org> wrote:
>
>> Hi Huidae,
>>
>> On Thu, Sep 25, 2014 at 6:20 PM, Huidae Cho <grass4u at 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
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20140930/6d7a476e/attachment.html>


More information about the grass-dev mailing list