[GRASS-dev] [GRASS GIS] #1768: wingrass6.x: python addon scripts aren't working

#1768: wingrass6.x: python addon scripts aren't working
-------------------------------------+--------------------------------------
Reporter: hellik | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 6.4.4
Component: Addons | Version: svn-releasebranch64
Keywords: wingrass, python, addon | Platform: MSWindows 7
      Cpu: x86-64 |
-------------------------------------+--------------------------------------
tested with

{{{
System Info
GRASS version: 6.4.3svn
GRASS SVN Revision: 53519
GIS Library Revision: 50937 (2012-02-25)
GDAL/OGR: GDAL 1.9.2, released 2012/10/08
PROJ4: Rel. 4.8.0, 6 March 2012
Python: 2.7.2
wxPython: 2.8.12.1
Platform: Windows-7-6.1.7601-SP1 (OSGeo4W)
}}}

and the wxgui-g.extension manager

exe-addons are installed here (e.g.):

{{{
C:\Users\xxxxx\AppData\Roaming\GRASS6\addons
r.xtent.exe
}}}

shell addon scripts and their related bat-files are in the same folder
(e.g.):

{{{
C:\Users\xxxxx\AppData\Roaming\GRASS6\addons
v.rast.stats2
v.rast.stats2.bat
}}}

the content of the related bat (e.g. v.rast.stats2.bat) is:

{{{
@"%GRASS_SH%" "%GRASS_ADDON_PATH%/v.rast.stats2" %*
}}}

shell scripts are working now (see ticket #1692).

there are also some nice python scripts for grass6.x in the addons

python addon scripts (i.e.) are placed at the moment into:

{{{
C:\Users\xxxxx\AppData\Roaming\GRASS6\addons
r.basin.py
r.ipso.py
r.wf.py
}}}

but the related bat-files are in:

{{{
C:\Users\xxxxx\AppData\Roaming\GRASS6\addons\bin
r.basin.py.bat
r.ipso.py.bat
r.wf.py.bat
}}}

the content of the related bat-files (e.g. r.basin.py.bat) is:

{{{
@"%GRASS_SH%" "%GISBASE%/scripts/r.basin.py" %*
}}}

the nice python addons scripts aren't working in the moment.

following issues:

'''(1)''' should the content of the related bat-files be changed to?:

{{{
@"%GRASS_PYTHON%" "%GISBASE%/scripts/r.basin.py" %*
}}}

'''(2)''' should the related bat-files be renamed?

r.basin.py.bat => r.basin.bat

because python addon scripts can invoke another python addon script
(e.g.):

{{{
r.basin.py
[...]
  grass.run_command('r.ipso', map = 'r_elevation_crop',
                                   image = prefix, flags = 'ab')
[...]
}}}

'''(3)''' should the related bat-files be moved like shell script bat-
files?

from

{{{
C:\Users\xxxxx\AppData\Roaming\GRASS6\addons\bin
}}}

to

{{{
C:\Users\xxxxx\AppData\Roaming\GRASS6\addons
}}}

Helmut

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1768&gt;
GRASS GIS <http://grass.osgeo.org>

#1768: wingrass6.x: python addon scripts aren't working
-------------------------------------+--------------------------------------
Reporter: hellik | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 6.4.4
Component: Addons | Version: svn-releasebranch64
Keywords: wingrass, python, addon | Platform: MSWindows 7
      Cpu: x86-64 |
-------------------------------------+--------------------------------------

Comment(by hamish):

For g6 there is an include/Make/Python.make, which it is unclear to me if
it should be used for python addons scripts instead of re-using
(shell)Script.make?, even though there are not really any python scripts
outside of the special GUI cases there are ones in the g6 addons repo
which need it.

Likewise, for g7, Script.make has been repurposed for python scripts, but
some accommodation should be available for end-users' personal shell
scripts in some "Shell.make" or similar. There is a Python.make in g7 too,
but it just seems to run the .pyc compiler.

Also in the tools/module_svn_propset.sh script, there is an open question:
should .py scripts have the exe bit set or not?

AFAIK we are all in agreement that python scripts should have .py
extensions in the source code repo(s), then the *.make rules strip those
off at install time.

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1768#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#1768: wingrass6.x: python addon scripts aren't working
-------------------------------------+--------------------------------------
Reporter: hellik | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 6.4.4
Component: Addons | Version: svn-releasebranch64
Keywords: wingrass, python, addon | Platform: MSWindows 7
      Cpu: x86-64 |
-------------------------------------+--------------------------------------

Comment(by hamish):

see also #1555

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1768#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#1768: wingrass6.x: python addon scripts aren't working
-------------------------------------+--------------------------------------
Reporter: hellik | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 6.4.4
Component: Python | Version: svn-releasebranch64
Keywords: wingrass, python, addon | Platform: MSWindows 7
      Cpu: x86-64 |
-------------------------------------+--------------------------------------
Changes (by hamish):

  * component: Addons => Python

Comment:

see also #1196 and #2010.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1768#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#1768: wingrass6.x: python addon scripts aren't working
-------------------------------------+--------------------------------------
Reporter: hellik | Owner: grass-dev@…
     Type: defect | Status: new
Priority: critical | Milestone: 6.4.4
Component: Python | Version: svn-releasebranch64
Keywords: wingrass, python, addon | Platform: MSWindows 7
      Cpu: x86-64 |
-------------------------------------+--------------------------------------

Comment(by wenzeslaus):

Main part of the issue continued in #2138. For GRASS 7, see #2150 and
[http://lists.osgeo.org/pipermail/grass-dev/2013-October/065904.html
Handling of Python scripts on MS Windows] ([http://osgeo-
org.1560.x6.nabble.com/Handling-of-Python-scripts-on-MS-Windows-
td5081335.html nabble]).

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1768#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#1768: wingrass6.x: python addon scripts aren't working
--------------------------+-------------------------------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: critical | Milestone: 6.4.4
Component: Python | Version: svn-releasebranch64
Resolution: duplicate | Keywords: wingrass, python, addon
  Platform: MSWindows 7 | Cpu: x86-64
--------------------------+-------------------------------------------------
Changes (by hellik):

  * status: new => closed
  * resolution: => duplicate

Comment:

Replying to [comment:4 wenzeslaus]:
> Main part of the issue continued in #2138. For GRASS 7, see #2150 and
[http://lists.osgeo.org/pipermail/grass-dev/2013-October/065904.html
Handling of Python scripts on MS Windows] ([http://osgeo-
org.1560.x6.nabble.com/Handling-of-Python-scripts-on-MS-Windows-
td5081335.html nabble]).

see r59764 and r59765 . closing ticket as more or less duplicate,
continued in #2138.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1768#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>