[GRASS-dev] RE: [GRASS-user] Question with Python-SWIG example [SEC=UNCLASSIFIED]

Martin Landa landa.martin at gmail.com
Tue May 18 16:07:19 EDT 2010


Hi,

2010/5/18 Glynn Clements <glynn at gclements.plus.com>:
> What platform, Python version, ctypesgen version?

Debian GNU/Linux unstable, x86-32
Python 2.5.5
ctypesgen from SVN

> The G_find_raster2() definition should look like:
>
> # /usr/local/src/grass/7.0/dist.i686-pc-linux-gnu/include/grass/gisdefs.h: 220
> if hasattr(_libs['grass_gis'], 'G_find_raster2'):
>    G_find_raster2 = _libs['grass_gis'].G_find_raster2
>    G_find_raster2.restype = ReturnString
>    G_find_raster2.argtypes = [String, String]

I found

dist.i686-pc-linux-gnu/etc/python/grass/lib/grass.py:    if
hasattr(_lib, 'G_find_raster2'):
dist.i686-pc-linux-gnu/etc/python/grass/lib/grass.py:
G_find_raster2 = _lib.G_find_raster2
dist.i686-pc-linux-gnu/etc/python/grass/lib/grass.py:
G_find_raster2.restype = String
dist.i686-pc-linux-gnu/etc/python/grass/lib/grass.py:
G_find_raster2.argtypes = [String, String]
dist.i686-pc-linux-gnu/etc/python/grass/lib/grass.py:
G_find_raster2.errcheck = ReturnString

> Does it work if you use ctypes manually, e.g.:

yes, it works.

Martin

-- 
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa


More information about the grass-dev mailing list