[GRASS-dev] pygrass - stdout2dict

Pietro peter.zamb at gmail.com
Tue Apr 7 03:58:05 PDT 2015


Hi Martin,



On Tue, Apr 7, 2015 at 11:10 AM, Martin Landa <landa.martin at gmail.com> wrote:
> pygrass manual uses stdout2dict() [1] which doesn't seems to be
> available.
>
> [1] http://grass.osgeo.org/grass70/manuals/libpython/pygrass_modules.html

You are right the function has not been defined... probably I can
simply update the docstring adding the function, something like:

{{{
def stdout2dict(stdout):
    return dict([kv.split('=') for kv in stdout.strip().split('\n')])
}}}

or with lambda

{{{
stdout2dict = lambda x: dict([i.split('=') for i in x.strip().split('\n')])
}}}

Best regards

Pietro


More information about the grass-dev mailing list