Browse Source

better use of tempfile.mkstemp() (https://trac.osgeo.org/grass/ticket/560, https://trac.osgeo.org/grass/ticket/943,comment:10, merge from devbr6 https://trac.osgeo.org/grass/changeset/56444)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@56445 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman 12 years ago
parent
commit
e07592b623
1 changed files with 7 additions and 7 deletions
  1. 7 7
      gui/wxpython/core/render.py

+ 7 - 7
gui/wxpython/core/render.py

@@ -69,17 +69,17 @@ class Layer(object):
         
         # 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