yes this is the problem indeed On Wed, 25 Jul 2018 at 13:21, Vaclav Petras <wenzesl...@gmail.com> wrote:
> > > On Wed, Jul 25, 2018, 3:34 AM Yann Chemin <dr.yann.che...@gmail.com> > wrote: > >> Hi, >> (script below) >> I get this error >> >> v.import_(input=adminfile,output="admin",quiet=True,superquiet=True) >> File "/usr/lib/grass74/etc/python/grass/pygrass/modules/shortcuts.py", >> line 47, in __getattr__ >> return self.cls('%s.%s' % (self.prefix, name.replace('_', '.'))) >> File >> "/usr/lib/grass74/etc/python/grass/pygrass/modules/interface/module.py", >> line 530, in __init__ >> raise GrassError(str_err % self.name) >> grass.exceptions.GrassError: Error running: `v.import. >> --interface-description`. >> > > It seems that PyGRASS does not support the "underscore at the end when > Python keyword". It just does it's usual thing which is replacing > underscores with dots like in r.slope_aspect. So probably a new > functionality needs to be added to replace import_ with just import. > Something like name.strip('_'). Please add a test for it. > > Best, > Vaclav > > > > >> #SCRIPT >> from grass_session import Session >> from grass.pygrass.modules.shortcuts import vector as v >> adminfile=gadm_FR_2_Morbihan.gpkg >> with Session(gisdb="/tmp", location="loc", create_opts="EPSG:4326"): >> v.import_(input=adminfile,output="admin",quiet=True,superquiet=True) >> _______________________________________________ >> grass-dev mailing list >> grass-dev@lists.osgeo.org >> https://lists.osgeo.org/mailman/listinfo/grass-dev > >
_______________________________________________ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev