commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r7298 - trunk/gnue-common/src/datasources


From: reinhard
Subject: [gnue] r7298 - trunk/gnue-common/src/datasources
Date: Tue, 5 Apr 2005 16:34:33 -0500 (CDT)

Author: reinhard
Date: 2005-04-05 16:34:32 -0500 (Tue, 05 Apr 2005)
New Revision: 7298

Modified:
   trunk/gnue-common/src/datasources/GConditions.py
Log:
Always create a GCondition instance in buildCondition, even if the parameter is
None.  Truth value of an empty condition is False.


Modified: trunk/gnue-common/src/datasources/GConditions.py
===================================================================
--- trunk/gnue-common/src/datasources/GConditions.py    2005-04-04 23:13:30 UTC 
(rev 7297)
+++ trunk/gnue-common/src/datasources/GConditions.py    2005-04-05 21:34:32 UTC 
(rev 7298)
@@ -282,6 +282,15 @@
       item.breakReferences ()
 
 
+  # ---------------------------------------------------------------------------
+  # Return False for an empty condition and True otherwise
+  # ---------------------------------------------------------------------------
+
+  def __nonzero__ (self):
+
+    return (isinstance (self, GConditionElement) or self._children)
+
+
 # =============================================================================
 # Top level classes 
 # =============================================================================
@@ -1361,8 +1370,8 @@
   elif isinstance (condition, GCondition):
     return condition
 
-  else:
-    return None
+  else: # None
+    return GCondition ()
 
 
 # -----------------------------------------------------------------------------





reply via email to

[Prev in Thread] Current Thread [Next in Thread]