Ñò
ÎÑAHc           @   sf   d  Z  d d k Z d d k Z e i i ƒ  Z d „  Z e i d e ƒ d d k	 Z	 e	 i
 d d ƒ d S(   s%    IPython extension: add %clear magic iÿÿÿÿNc         C   sü  |  i  ƒ  } xé| i ƒ  D]Û} | d j o' d t | i d ƒ GH|  i i ƒ  q | d j oˆ d GHd d k l } |  i i d } x: t	 d | ƒ D]) } d	 | } y |  i | =Wq• q• Xq• Wd
 g | |  i
 (d
 g | |  i (q | d j o{ yR t i i } x? |  i i ƒ  D]. }	 t |  i |	 | i ƒ o |  i |	 =qqWWn t j
 o d GHn Xt i ƒ  q | d j o d GH| i i d ƒ q | d j o0 d GHxI t i i d ƒ D] }
 t i |
 =q»Wq | d j o d GHt i d 2q q Wd S(   s>   Clear various data (e.g. stored history data)
    
    %clear out - clear output history
    %clear in  - clear input history
    %clear shadow_compress - Compresses shadow history (to speed up ipython)
    %clear shadow_nuke - permanently erase all entries in shadow history
    %clear dhist - clear dir history
    t   outs"   Flushing output cache (%d entries)t   _oht   ins   Flushing input historyiÿÿÿÿ(   t   iplibi   t   _is   
t   arrays)   Clear array only available in -pylab modet   shadow_compresss   Compressing shadow historyt
   shadowhistt   shadow_nukes$   Erased all keys from shadow history s   shadowhist/*t   dhists   Clearing directory historyt   _dhN(   t   getapit   splitt   lent   user_nst   outputcachet   flusht   IPythonR   t   prompt_countt   ranget
   input_histt   input_hist_rawt   ipt   IPt   pylabt   keyst
   isinstancet	   arraytypet   AttributeErrort   gct   collectt   dbt	   hcompress(   t   selft   argt   apit   targetR   t   pct   nt   keyR   t   xt   k(    (    sS   /u/d/b/dbachman/web/work/lib/python2.3/site-packages/IPython/Extensions/clearcmd.pyt   clear_f	   sP    
    
 t   clears   %clears(   in out shadow_nuke shadow_compress dhist(   t   __doc__t   IPython.ipapiR   R   t   ipapit   getR   R*   t   expose_magict   ipy_completerst   quick_completer(    (    (    sS   /u/d/b/dbachman/web/work/lib/python2.3/site-packages/IPython/Extensions/clearcmd.pyt   <module>   s   	2