[GRASS-SVN] r56445 - grass/trunk/gui/wxpython/core

svn_grass at osgeo.org svn_grass at osgeo.org
Tue May 28 03:19:45 PDT 2013


Author: hamish
Date: 2013-05-28 03:19:45 -0700 (Tue, 28 May 2013)
New Revision: 56445

Modified:
   grass/trunk/gui/wxpython/core/render.py
Log:
better use of tempfile.mkstemp() (#560, #943,comment:10, merge from devbr6 r56444)

Modified: grass/trunk/gui/wxpython/core/render.py
===================================================================
--- grass/trunk/gui/wxpython/core/render.py	2013-05-28 07:32:13 UTC (rev 56444)
+++ grass/trunk/gui/wxpython/core/render.py	2013-05-28 10:19:45 UTC (rev 56445)
@@ -69,17 +69,17 @@
         
         # generated file for each layer
         if USE_GPNMCOMP or ltype == 'overlay':
-            tmpfile = tempfile.mkstemp()[1]
-            self.maskfile = tmpfile + '.pgm'
             if ltype == 'overlay':
-                self.mapfile  = tmpfile + '.png'
+                tempfile_sfx = ".png"
             else:
-                self.mapfile  = tmpfile + '.ppm'
-            grass.try_remove(tmpfile)
+                tempfile_sfx = ".ppm"
+
+            self.mapfile = tempfile.mkstemp(suffix = tempfile_sfx)[1]
+            self.maskfile = self.mapfile.rsplit(".",1)[0] + ".pgm"
         else:
             self.mapfile = self.maskfile = None
-        
-        # stores class which manages rendering instead of simple command - e. g. wms
+
+        # stores class which manages rendering instead of simple command - e.g. WMS
         self.renderMgr = None
 
         self.Map = Map



More information about the grass-commit mailing list