[GRASS-dev] [GRASS GIS] #3489: integrate grass session lib

GRASS GIS trac at osgeo.org
Sun Feb 4 13:57:40 PST 2018


#3489: integrate grass session lib
--------------------------+-------------------------
  Reporter:  martinl      |      Owner:  grass-dev@…
      Type:  task         |     Status:  new
  Priority:  normal       |  Milestone:  7.6.0
 Component:  Python       |    Version:  svn-trunk
Resolution:               |   Keywords:
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+-------------------------

Comment (by hellik):

 Replying to [ticket:3489 martinl]:
 > Hi,
 >
 > it would be nice to integrate Python grass_session lib (1) into GRASS
 code base. For G76 imported simply by
 >
 > {{{
 > from grass.session import Session
 > }}}
 >
 > What do you think?
 >
 > (1) https://github.com/zarch/grass-session

 looks interesting.

 a quick scrolling over the code

 e.g.

 {{{
 DEFAULTBIN = "grass{version}"
 DEFAULTGRASSBIN = dict(win32="C:\OSGeo4W\bin\grass{version}svn.bat",
                        darwin=("/Applications/GRASS/"
 "GRASS-{version[0]}.{version[1]}.app/"))
 }}}

 {{{
     def get_platform():
         if sys.platform == "win32":
 return "win32
 }}}

 {{{
         config_dirname = "GRASS7"
     if platform == "win32":
         config_dir = os.path.join(os.getenv('APPDATA'), config_dirname)
         env['PATH'] += os.pathsep + os.path.join(gisbase, 'extrabin')
         env['GRASS_PYTHON'] = env.get('GRASS_PYTHON', "python.exe")
 env['GRASS_SH'] = os.path.join(gisbase, 'msys', 'bin', 'sh.exe')
 }}}

 maybe some finetuning regarding win 32bit/64bit and OSGeo4W/standalone
 winGRASS is needed?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3489#comment:2>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list