[GRASS-SVN] r50525 - grass/branches/develbranch_6/gui/wxpython/psmap

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jan 28 07:37:11 EST 2012


Author: annakrat
Date: 2012-01-28 04:37:11 -0800 (Sat, 28 Jan 2012)
New Revision: 50525

Modified:
   grass/branches/develbranch_6/gui/wxpython/psmap/frame.py
Log:
wxGUIwxpsmap: minor changes in generating temp file

Modified: grass/branches/develbranch_6/gui/wxpython/psmap/frame.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/psmap/frame.py	2012-01-28 12:35:43 UTC (rev 50524)
+++ grass/branches/develbranch_6/gui/wxpython/psmap/frame.py	2012-01-28 12:37:11 UTC (rev 50525)
@@ -145,7 +145,7 @@
         
         # image path
         env = grass.gisenv()
-        self.imgName = os.path.join(env['GISDBASE'], env['LOCATION_NAME'], env['MAPSET'], '.tmp', 'tmpImage.png')
+        self.imgName = grass.tempfile()
         
         #canvas for preview
         self.previewCanvas = PsMapBufferedWindow(parent = self, mouse = self.mouse, cursors = self.cursors,
@@ -316,13 +316,13 @@
                 if self.instruction[self.pageId]['Orientation'] == 'Landscape':
                     im = im.rotate(270)
                 
-                im.save(self.imgName, format = 'png')
+                im.save(self.imgName, format = 'PNG')
                 
             except IOError, e:
                 GError(parent = self,
                        message = _("Unable to generate preview. %s") % e)
+                return
             
-            
                 
             rect = self.previewCanvas.ImageRect()
             self.previewCanvas.image = wx.Image(self.imgName, wx.BITMAP_TYPE_PNG)



More information about the grass-commit mailing list