Moritz Lennert wrote:
> Any reason why the solution using splitlines() is not acceptable:
>
> maps=grass.read_command('g.mlist',
> pattern='rast_*|crast_*|Treene_raster', type='rast').splitlines()
No, but it shouldn't be necessary; such fundamental operations should
have dedicated library functions. Ideally, any "query" module should
have a corresponding Python function which returns the information
using appropriate Python data types.
In fact, grass.script.core used to have a function mlist() which would
do this, but for some reason it was removed in r47427.
In r50971 I've added mlist_pairs and mlist_strings (analogous to
list_pairs and list_strings), and added a flag= option to all three;
'r' for basic regexps, 'e' for extended regexps, '' (the default) for
glob patterns.
--
Glynn Clements <[email protected]>
_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user