[GRASS-dev] Makefile related problem? Re: [GRASS-user] Confused when using i.fusion.brovey

Nikos Alexandris nik at nikosalexandris.net
Mon Nov 10 07:03:26 PST 2014


Nikos Alexandris wrote:

> > I have this script
> > <https://github.com/NikosAlexandris/i.fusion.hpf.py>. My local
> > Makefile, with which I am trying to compile currently, is:
 
> >   MODULE_TOPDIR = ../..
> >
> >   PGM = i.fusion.hpf
> >
> >   ETCFILES = high_pass_filter constants
> >
> >   include $(MODULE_TOPDIR)/include/Make/Script.make
> >   include $(MODULE_TOPDIR)/include/Make/Python.make
 
> > * Is the order of entries in ETCFILES significant? (high_pass_filter
> > needs stuff from constants)
 
> > * While both files are to be found, after compilation, under
> > </grass70/dist.x86_64-unknown-linux-gnu/etc/i.fusion.hpf>, the script
> > runs fine only when executing it from *any*, if I understand
> > correctly, directory in which the helper file(s)
> > "high_pass_filter.py(c)" is(are) in.
 
> > I can't work this out. Thank you, Nikos
> 
> Thanks to "r.in.wms", fixed by using this line:
> 
> +sys.path.insert(1, os.path.join(os.path.dirname(sys.path[0]), 'etc', 
> 'r.in.wms'))

This approach broke for my script i.fusion.hpf again. The sys.path[0] is an empty string (now). I have
no idea why it did work before.

Is the approach in v.class.ml relevant/better/safer:
<http://trac.osgeo.org/grass/browser/grass-addons/grass7/vector/v.class.ml/v.class.ml.py?order=date#L380>?


Nikos


More information about the grass-dev mailing list