Implement BlockerCache.keys() so that DictMixin.__repr__() works.
authorZac Medico <zmedico@gentoo.org>
Tue, 3 Jul 2007 06:23:22 +0000 (06:23 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 3 Jul 2007 06:23:22 +0000 (06:23 -0000)
svn path=/main/trunk/; revision=7135

pym/emerge/__init__.py

index 28d36919ca824045b8ef36d48bb633d70cc29e67..ec7c1ec9a80333c34b8e0866661f83356113bc5e 100644 (file)
@@ -960,6 +960,13 @@ class BlockerCache(DictMixin):
                """
                return self.BlockerData(*self._cache_data["blockers"][cpv])
 
+       def keys(self):
+               """This needs to be implemented so that self.__repr__() doesn't raise
+               an AttributeError."""
+               if self._cache_data and "blockers" in self._cache_data:
+                       return self._cache_data["blockers"].keys()
+               return []
+
 def show_invalid_depstring_notice(parent_node, depstring, error_msg):
 
        from formatter import AbstractFormatter, DumbWriter