[gedit-plugins/wip/python3] Implemented __eq__ for result



commit 2b0010db39d4f25e5931f4e7536d51587cbcd81e
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Fri Nov 9 11:51:05 2012 +0100

    Implemented __eq__ for result

 plugins/commander/commander/commands/result.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/plugins/commander/commander/commands/result.py b/plugins/commander/commander/commands/result.py
index 8cc9fc3..c9058a7 100644
--- a/plugins/commander/commander/commands/result.py
+++ b/plugins/commander/commander/commands/result.py
@@ -37,6 +37,12 @@ class Result(object):
         else:
             return int(self) < other
 
+    def __eq__(self, other):
+        if isinstance(other, Result):
+            return int(self) == int(other)
+        else:
+            return int(self) == other
+
 # Easy shortcuts
 HIDE = Result(Result.HIDE)
 DONE = Result(Result.DONE)



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