[GRASS-SVN] r52630 - grass/trunk/gui/wxpython/swipe

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Aug 11 14:26:18 PDT 2012


Author: wenzeslaus
Date: 2012-08-11 14:26:18 -0700 (Sat, 11 Aug 2012)
New Revision: 52630

Modified:
   grass/trunk/gui/wxpython/swipe/main.py
Log:
wxGUI/swipe: fix checking params

Modified: grass/trunk/gui/wxpython/swipe/main.py
===================================================================
--- grass/trunk/gui/wxpython/swipe/main.py	2012-08-11 20:48:15 UTC (rev 52629)
+++ grass/trunk/gui/wxpython/swipe/main.py	2012-08-11 21:26:18 UTC (rev 52630)
@@ -44,20 +44,22 @@
     first = options['first']
     second = options['second']
 
-    gfile = grass.find_file(name = first)
-    if not gfile['name']:
-        grass.fatal(_("Raster map <%s> not found") % first)
+    for mapName in [first, second]:    
+        if mapName:
+            gfile = grass.find_file(name = mapName)
+            if not gfile['name']:
+                grass.fatal(_("Raster map <%s> not found") % mapName)
 
-    gfile = grass.find_file(name = second)
-    if not gfile['name']:
-        grass.fatal(_("Raster map <%s> not found") % second)
-
     app = wx.PySimpleApp()
     wx.InitAllImageHandlers()
 
     frame = SwipeMapFrame()
-    frame.SetFirstRaster(first)
-    frame.SetSecondRaster(second)
+    
+    if first:
+        frame.SetFirstRaster(first)
+    if second:
+        frame.SetSecondRaster(second)
+
     frame.Show()
 
     app.MainLoop()



More information about the grass-commit mailing list