[GRASS-dev] r49166 consolidating flags from r.info

Hamish hamish_b at yahoo.com
Thu Nov 10 17:54:17 EST 2011


Hamish wrote:
> I am not so sure about r49166. I don't really
> mind about adding map type and res to -g to make
> it more like 'g.region -g', but wonder if things
> like vertical datum and data units should only
> export if they actually exist.
> 
> Note -t can't be included, as if the title contains chars like () then 
> eval `r.info -g`  will fail.
> 
> (for `r.info -t` I've always had to use
> `cut -f2- -d=` instead of eval)

hmm, vdatum= and units= are also free-form text
fields and so can not be part of 'eval `r.info -g`'
either. (which must be supported for end-users,
even if shell scripts are not used by the official
release)


also, for core.py's parse_key_val(), if a free-
form string is parsed, and the string contains '=',
then "v = kv[1]" will chop it off prematurely.
(this is a bug in all branches)


probably
 def parse_key_val(s, sep = '=', dflt = None, val_type = None, vsep = None)

needs to have another argument added like
 ..., to_eol = False):

to allow an effect like .split('=')[1:end]
instead of just the kv[1] element.


Hamish


More information about the grass-dev mailing list