From a2da915215f1b7cd44d8d9abc62a256db0c17d1d 2012-01-21 04:22:08
From: Paul Ivanov <pivanov314@gmail.com>
Date: 2012-01-21 04:22:08
Subject: [PATCH] inoculate %clear magic from quarantine

---

diff --git a/IPython/quarantine/clearcmd.py b/IPython/extensions/clearcmd.py
similarity index 91%
rename from IPython/quarantine/clearcmd.py
rename to IPython/extensions/clearcmd.py
index 7b140e4..c61f1f2 100644
--- a/IPython/quarantine/clearcmd.py
+++ b/IPython/extensions/clearcmd.py
@@ -30,7 +30,7 @@ def clear_f(self,arg):
     Clearing directory history
     """
 
-    api = self.getapi()
+    api = self.get_ipython()
     user_ns = self.user_ns  # local lookup, heavily used
 
 
@@ -38,11 +38,11 @@ def clear_f(self,arg):
 
         if target == 'out':
             print "Flushing output cache (%d entries)" % len(user_ns['_oh'])
-            self.outputcache.flush()
+            self.displayhook.flush()
 
         elif target == 'in':
             print "Flushing input history"
-            pc = self.outputcache.prompt_count + 1
+            pc = self.displayhook.prompt_count + 1
             for n in range(1, pc):
                 key = '_i'+`n`
                 user_ns.pop(key,None)
@@ -82,6 +82,5 @@ def clear_f(self,arg):
 
 # Activate the extension
 ip.define_magic("clear",clear_f)
-import ipy_completers
-ipy_completers.quick_completer(
-    '%clear','in out shadow_nuke shadow_compress dhist')
+from IPython.core.completerlib import quick_completer
+quick_completer( '%clear','in out shadow_nuke shadow_compress dhist')