[Greater-commits] r398 - trunk/GREAT-ER/Greater/UI

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Jul 11 12:11:49 CEST 2011


Author: bricks
Date: 2011-07-11 12:11:49 +0200 (Mon, 11 Jul 2011)
New Revision: 398

Modified:
   trunk/GREAT-ER/Greater/UI/context.py
Log:
Fix: Check if map is a GreaterMap


Modified: trunk/GREAT-ER/Greater/UI/context.py
===================================================================
--- trunk/GREAT-ER/Greater/UI/context.py	2011-07-11 10:10:41 UTC (rev 397)
+++ trunk/GREAT-ER/Greater/UI/context.py	2011-07-11 10:11:49 UTC (rev 398)
@@ -68,6 +68,7 @@
 def discharge_layer_visible(context):
     """Return true there is a discharge layer and it is visible"""
     return context.mainwindow.canvas.Map() is not None and \
+           hasattr(context.mainwindow.canvas.Map(), "DischargeLayer") and \
            context.mainwindow.canvas.Map().DischargeLayer() is not None and \
            context.mainwindow.canvas.Map().DischargeLayer().Visible()
 
@@ -117,6 +118,7 @@
     layer."""
     return context_catchment_open(context) and \
            context.mainwindow.canvas.Map() is not None and \
+           hasattr(context.mainwindow.canvas.Map(), "PicturesLayer") and \
            context.mainwindow.canvas.Map().PicturesLayer() is not None
 
 def context_pics_exist_and_layer_visible(context):



More information about the Greater-commits mailing list