[conduit/gsoc09_alexandre: 17/24] Another take at fixing categories using modules cache (hopefully it works now).



commit 69f3b105e275c62286586f28a1176c74b61d1e34
Author: Alexandre Rosenfeld <airmind gmail com>
Date:   Sat Aug 1 02:06:03 2009 -0300

    Another take at fixing categories using modules cache (hopefully it works now).

 conduit/ModuleWrapper.py                      |    2 +-
 conduit/dataproviders/DataProviderCategory.py |    5 +++++
 2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/conduit/ModuleWrapper.py b/conduit/ModuleWrapper.py
index f346693..0fe696a 100644
--- a/conduit/ModuleWrapper.py
+++ b/conduit/ModuleWrapper.py
@@ -93,7 +93,7 @@ class ModuleWrapper:
             'out_type': self.out_type,
             'configurable': self.configurable,
             'classname': self.classname,
-            'category': self.category.name}
+            'category': self.category}
 
     def __str__(self):
         return "Wrapper: %s %s (UID: %s)" % (self.get_name(), self.module_type, self.get_UID())
diff --git a/conduit/dataproviders/DataProviderCategory.py b/conduit/dataproviders/DataProviderCategory.py
index e0b5729..7f0d789 100644
--- a/conduit/dataproviders/DataProviderCategory.py
+++ b/conduit/dataproviders/DataProviderCategory.py
@@ -3,3 +3,8 @@ class DataProviderCategory:
         self.name = name
         self.icon = icon
         self.key = name + key
+        
+    def __cmp__(self, other):
+        if isinstance(other, DataProviderCategory):
+            return other.key == self.key
+        return False



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