[GRASS-SVN] r60946 - grass/branches/develbranch_6/gui/wxpython/core

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jun 24 10:25:31 PDT 2014


Author: annakrat
Date: 2014-06-24 10:25:31 -0700 (Tue, 24 Jun 2014)
New Revision: 60946

Modified:
   grass/branches/develbranch_6/gui/wxpython/core/render.py
Log:
wxGUI/render: attempt to fix #560

Modified: grass/branches/develbranch_6/gui/wxpython/core/render.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/core/render.py	2014-06-24 14:38:52 UTC (rev 60945)
+++ grass/branches/develbranch_6/gui/wxpython/core/render.py	2014-06-24 17:25:31 UTC (rev 60946)
@@ -91,7 +91,10 @@
             tempfile_sfx = ".png"
         else:
             tempfile_sfx = ".ppm"
-        self.mapfile = tempfile.mkstemp(suffix = tempfile_sfx)[1]
+        mapfile = tempfile.NamedTemporaryFile(suffix=tempfile_sfx, delete=False)
+        # we don't want it open, we just need the name
+        self.mapfile = mapfile.name
+        mapfile.close()
         # do we need to `touch` the maskfile so it exists?
         self.maskfile = self.mapfile.rsplit(".",1)[0] + ".pgm"
 
@@ -132,8 +135,10 @@
                 tempfile_sfx =".png"
             else:
                 tempfile_sfx =".ppm"
-            self.mapfile = tempfile.mkstemp(suffix = tempfile_sfx)[1]
-            # do we need to `touch` the maskfile so it exists?
+            mapfile = tempfile.NamedTemporaryFile(suffix=tempfile_sfx, delete=False)
+            # we don't want it open, we just need the name
+            self.mapfile = mapfile.name
+            mapfile.close()
             self.maskfile = self.mapfile.rsplit(".",1)[0] + ".pgm"
 
         if UserSettings.Get(group='display', key='driver', subkey='type') == 'cairo':
@@ -384,7 +389,10 @@
         self.gisrc = gisrc
         
         # generated file for g.pnmcomp output for rendering the map
-        self.mapfile = tempfile.mkstemp(suffix = '.ppm')[1]
+        mapfile = tempfile.NamedTemporaryFile(suffix='.ppm', delete=False)
+        # we don't want it open, we just need the name
+        self.mapfile = mapfile.name
+        mapfile.close()
         
         # setting some initial env. variables
         self._initGisEnv() # g.gisenv



More information about the grass-commit mailing list