[GRASS-SVN] r69192 - in grass-addons/grass7/raster/r.agent: libagent r.agent.aco r.agent.rand
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Aug 21 12:34:18 PDT 2016
Author: martinl
Date: 2016-08-21 12:34:18 -0700 (Sun, 21 Aug 2016)
New Revision: 69192
Modified:
grass-addons/grass7/raster/r.agent/libagent/Makefile
grass-addons/grass7/raster/r.agent/r.agent.aco/r.agent.aco.py
grass-addons/grass7/raster/r.agent/r.agent.rand/r.agent.rand.py
Log:
r.agent: attempt to fix compilation (see #2480)
Modified: grass-addons/grass7/raster/r.agent/libagent/Makefile
===================================================================
--- grass-addons/grass7/raster/r.agent/libagent/Makefile 2016-08-21 19:05:45 UTC (rev 69191)
+++ grass-addons/grass7/raster/r.agent/libagent/Makefile 2016-08-21 19:34:18 UTC (rev 69192)
@@ -3,9 +3,11 @@
include $(MODULE_TOPDIR)/include/Make/Other.make
include $(MODULE_TOPDIR)/include/Make/Python.make
-MODULES = agent anthill ant error grassland playground world
+MODULES = agent anthill ant error grassland playground world __init__
-ETCDIR = $(ETC)/r.agent
+PGM = r.agent
+LIBDIR = libagent
+ETCDIR = $(ETC)/$(PGM)/$(LIBDIR)
PYFILES := $(patsubst %,$(ETCDIR)/%.py,$(MODULES))
PYCFILES := $(patsubst %,$(ETCDIR)/%.pyc,$(MODULES))
@@ -19,4 +21,5 @@
$(INSTALL_DATA) $< $@
install:
- cp -r $(ETCDIR) $(INST_DIR)/etc
+ $(MKDIR) $(INST_DIR)/etc/$(PGM)
+ cp -r $(ETCDIR) $(INST_DIR)/etc/$(PGM)/$(LIBDIR)
Modified: grass-addons/grass7/raster/r.agent/r.agent.aco/r.agent.aco.py
===================================================================
--- grass-addons/grass7/raster/r.agent/r.agent.aco/r.agent.aco.py 2016-08-21 19:05:45 UTC (rev 69191)
+++ grass-addons/grass7/raster/r.agent/r.agent.aco/r.agent.aco.py 2016-08-21 19:34:18 UTC (rev 69192)
@@ -223,21 +223,17 @@
from math import sqrt
from math import exp
from random import randint
-import grass.script as grass
-from grass.pygrass.utils import get_lib_path
-path = get_lib_path(modname='r.agent', libname='libagent')
-if path is None:
- grass.fatal("Not able to find the agent library directory.")
-sys.path.append(path)
-
-import error, grassland, anthill
-
try:
from grass.script import core as grass
except ImportError:
raise error.EnvError("r.agent.aco:", "Please run inside GRASS.")
+from grass.pygrass.utils import set_path
+
+set_path('r.agent', 'libagent', '..')
+from libagent import error, grassland, anthill
+
def setmaps(site, cost, wastecosts, inphero, outphero, wastephero):
"""
Set the user maps in place
Modified: grass-addons/grass7/raster/r.agent/r.agent.rand/r.agent.rand.py
===================================================================
--- grass-addons/grass7/raster/r.agent/r.agent.rand/r.agent.rand.py 2016-08-21 19:05:45 UTC (rev 69191)
+++ grass-addons/grass7/raster/r.agent/r.agent.rand/r.agent.rand.py 2016-08-21 19:34:18 UTC (rev 69192)
@@ -82,21 +82,17 @@
from math import sqrt
from math import exp
from random import randint
-import grass.script as grass
-from grass.pygrass.utils import get_lib_path
-path = get_lib_path(modname='r.agent', libname='libagent')
-if path is None:
- grass.fatal("Not able to find the agent library directory.")
-sys.path.append(path)
-
-import error, grassland, world
-
try:
from grass.script import core as grass
except ImportError:
raise error.EnvError("r.agent.rand:", "Please run inside GRASS.")
+from grass.pygrass.utils import get_lib_path
+
+set_path('r.agent', 'libagent', '..')
+from libagent import error, grassland, world
+
def setmaps(cost, output):
"""
Set the user maps in place
More information about the grass-commit
mailing list