[GRASS-dev] [GRASS GIS] #3537: Add functionalities –tmp-location and –no-clean

GRASS GIS trac at osgeo.org
Sun Aug 19 12:57:44 PDT 2018


#3537: Add functionalities –tmp-location and –no-clean
-----------------------------+------------------------------------------
  Reporter:  radeknovotny94  |      Owner:  grass-dev@…
      Type:  enhancement     |     Status:  closed
  Priority:  normal          |  Milestone:  7.6.0
 Component:  Startup         |    Version:  svn-trunk
Resolution:  fixed           |   Keywords:  tmp-location, no-clean, exec
       CPU:  All             |   Platform:  All
-----------------------------+------------------------------------------

Comment (by Nikos Alexandris):

 A suggestion to check for if the 'geofile' (in `grass.py` named as
 `geostring`) exists and if it is is readable:
 https://trac.osgeo.org/grass/attachment/ticket/3537/grass.py_check_geostring.patch.

 I believe to have tested this properly.
 I could not follow what is recommended at
 https://stackoverflow.com/a/82852/1172302.
 In example, something like

 {{{
 try:
     geostring = pathlib.Path(geostring)
     geostring.resolve()
 except IOError as e:
     fatal(_("{error}"
         "\n\n"
         "Check spelling "
         "or the file's read permissions.").format(error=e))
 else:
     # create location using georeferenced file
     gcore.create_location(gisdbase, location,
             filename=geostring)

 }}}

 would not test for read access. I could find a way to test for read access
 using something from https://docs.python.org/3/library/pathlib.html.

 Maybe this can be implemented by using "future" built-in exceptions as
 FileNotFoundError (see https://docs.python.org/3/library/exceptions.html)?

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



More information about the grass-dev mailing list