Opened 7 years ago

Closed 6 years ago

#1768 closed defect (duplicate)

wingrass6.x: python addon scripts aren't working

Reported by: hellik Owned by: grass-dev@…
Priority: critical Milestone: 6.4.4
Component: Python Version: svn-releasebranch64
Keywords: wingrass, python, addon Cc:
CPU: x86-64 Platform: MSWindows 7

Description

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

Change History (5)

comment:1 Changed 7 years ago 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

comment:2 Changed 6 years ago by hamish

see also #1555

comment:3 Changed 6 years ago by hamish

Component: AddonsPython

see also #1196 and #2010.

comment:4 Changed 6 years ago by wenzeslaus

Main part of the issue continued in #2138. For GRASS 7, see #2150 and Handling of Python scripts on MS Windows (nabble).

comment:5 in reply to:  4 Changed 6 years ago by hellik

Resolution: duplicate
Status: newclosed

Replying to wenzeslaus:

Main part of the issue continued in #2138. For GRASS 7, see #2150 and Handling of Python scripts on MS Windows (nabble).

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

Note: See TracTickets for help on using tickets.