Index: ftp_stat_cache.py
===================================================================
--- ftp_stat_cache.py (revision 548:755b538cb146)
+++ ftp_stat_cache.py (revision 549:a2c8c2c58a2a)
@@ -46,8 +46,8 @@
         self._debug = False
         self.enabled = True
+        #self.enabled = False
 
-    def _debug_output(self, text):
-        if self._debug:
-            print "***", text
+    def clear(self):
+        self._cache.clear()
 
     def invalidate(self, path):
@@ -57,8 +57,9 @@
             pass
 
-    def clear(self):
-        self._cache.clear()
-
     def __getitem__(self, path):
+        """
+        Return the stat entry for the `path`. If there's no stored
+        stat entry, raise `CacheMissError`.
+        """
         try:
             lines = self._cache[path]
@@ -67,5 +68,5 @@
         except KeyError:
             self._debug_output("Requested path %s ... _not_ found" % path)
-            raise CacheMissError
+            raise CacheMissError("no path %s in cache" % path)
 
     def __setitem__(self, path, lines):
@@ -77,10 +78,18 @@
 
     def __contains__(self, path):
-        return path in self._cache
+        return (path in self._cache)
+
+    # the following methods are only intended for debugging!
+    def _debug_output(self, text):
+        if self._debug:
+            print "***", text
+
+    def __len__(self):
+        return len(self._cache)
 
     def __str__(self):
         lines = []
         for key in sorted(self._cache):
-            lines.append(key)
+            lines.append("%s: %s" % (key, self[key]))
         return "\n".join(lines)
 
