[GRASS-dev] [GRASS GIS] #2150: Cannot call Python scripts from Python on MS Windows

GRASS GIS trac at osgeo.org
Sat Sep 13 07:40:15 PDT 2014


#2150: Cannot call Python scripts from Python on MS Windows
-------------------------------------------+--------------------------------
 Reporter:  wenzeslaus                     |       Owner:  grass-dev@…              
     Type:  defect                         |      Status:  new                      
 Priority:  blocker                        |   Milestone:  7.0.0                    
Component:  Python                         |     Version:  svn-releasebranch64      
 Keywords:  packaging, MAXREPEAT, scripts  |    Platform:  MSWindows 7              
      Cpu:  Unspecified                    |  
-------------------------------------------+--------------------------------

Comment(by martinl):

 Replying to [comment:17 wenzeslaus]:
 > I'm not sure what is the status now, to be honest.
 >
 > Here is the current (r61885) diff of `grass.script.core.Popen` class:

 right, I have changed `Popen` class according to trunk in r61890 and will
 check the next WinGRASS build.

 > The 7.0 release branch contains the code which adds `sys.executable`
 before executing. The trunk contains the code which finds the the exact
 executable but I'm not sure about the rest. Especially why it is better
 then the solution in 7.0 branch and if BAT files are even required since
 all the work must be done "manually" in Popen class anyway (which seems to
 bring us back to r57910).

 [...]

 > Whatever is the solution it should be used in GUI and for user scripts
 (e.g. I suggested to provide BAT files using `g.extension` for Python user
 scripts on MS Windows in the same way `g.extension` can be used for C
 modules on unix, see #1652.)

 They are provided automatically in zip files (1). The bat files are
 created by building system. The missing part speaking about BAT files are
 probably user scripts which are not installed via G7:g.extension. The way
 could be to extent wxGUI code
 source:grass/trunk/gui/wxpython/lmgr/frame.py#L829 to generate BAT files
 automatically or to design a new module which could allow to create BAT
 files also from terminal (which will be probably very rare situation when
 speaking about Windows users, so probably not needed).

 (1)
 http://wingrass.fsv.cvut.cz/grass71/addons/grass-7.1.svn/logs/d.mon2.log

 {{{
 sed -e "s#SCRIPT_NAME#d.mon2#" -e "s#SCRIPT_DIR#%GISBASE%/scripts#"
 /c/osgeo4w/usr/src/grass_trunk/scripts/windows_launch.bat >
 /c/Users/landa/grass_packager/grass71/addons/d.mon2/bin/d.mon2.bat
 unix2dos
 /c/Users/landa/grass_packager/grass71/addons/d.mon2/bin/d.mon2.bat
 unix2dos: converting file
 /c/Users/landa/grass_packager/grass71/addons/d.mon2/bin/d.mon2.bat to DOS
 format ...
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2150#comment:18>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list