;ò
ÎÑAHc           @   s  d  Z  d k Z d k Z d k Z d k Z d k Z d k Z d k Z d k Z d k	 Z	 d „  Z
 e
 ƒ  Z d e f d „  ƒ  YZ d „  Z e d „ Z e ƒ  Z d k Z e a d „  Z d „  Z d	 „  Z d k Z e i i ƒ  Z d
 d „ Z d
 d „ Z d „  Z e ƒ  d S(   st   
IPython extension: autoreload modules before executing the next line

Try:: 

    %autoreload?

for documentation.
Nc          C   s<   x5 t  i ƒ  D]' \ }  } } | t  i j o |  Sq q Wd S(   sB   Official way to get the extension of compiled files (.pyc or .pyo)N(   s   imps   get_suffixess   exts   modes   typs   PY_COMPILED(   s   exts   typs   mode(    (    sR   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_autoreload.pys   _get_compiled_ext   s
      s   ModuleReloaderc           B   s,   t  Z h  Z h  Z h  Z e Z e d „ Z RS(   Nc   
      C   sé  | p |  i  o t i i ƒ  } n |  i i ƒ  } x¯| D]§} t i i | t ƒ } | |  i	 j o q: n t
 | d ƒ o q: n | i d j o q: n | i } t i i | ƒ }	 t i i | ƒ \ } } | i ƒ  d j o# t } t i i |	 | t ƒ } n | t j o q: n ya t i | d  ƒ i } | t i | ƒ i j o w: n |  i i | d  t ƒ | j o w: n Wn t j
 o
 q: n Xy4 t | ƒ | d  |  i j o |  i | d  =n Wq: | |  i | d  <q: Xq: Wd S(   s/   Check whether some modules need to be reloaded.s   __file__s   __main__s   .pyiÿÿÿÿN(   s	   check_alls   selfs   syss   moduless   keyss   modnames   gets   Nones   ms   skip_moduless   hasattrs   __name__s   __file__s   filenames   oss   paths   dirnames   splitexts   exts   lowers   PY_COMPILED_EXTs   joins   stats   st_mtimes   pymtimes   skippeds   OSErrors   superreload(
   s   selfs	   check_alls   modnames   pymtimes   moduless   ms   filenames   exts   paths   dirname(    (    sR   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_autoreload.pys   check,   sF      	 
(	   s   __name__s
   __module__s   skippeds   moduless   skip_moduless   Trues	   check_alls   Falses   check(    (    (    sR   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_autoreload.pys   ModuleReloader   s       c         C   s.   x' | D] } t |  | t | | ƒ ƒ q Wd  S(   N(   s	   attrnamess   names   setattrs   olds   getattrs   new(   s   olds   news	   attrnamess   name(    (    sR   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_autoreload.pys   update_function\   s     c         C   s#  | |  ƒ }  d } x|  i i ƒ  D]õ \ } } |  i | f } t	 i
 | ƒ oÊ xÇ t	 | D]· } t | ƒ t i j o! | i i | i ƒ | d 7} qX t | ƒ t i j o$ t | | d i ƒ  ƒ | d 7} qX t | ƒ t i j o* t | i | i d i ƒ  ƒ | d 7} qX qX Wq" q" W|  Sd S(   så   Enhanced version of the builtin reload function.
    
    superreload replaces the class dictionary of every top-level
    class in the module with the new one automatically,
    as well as every function's code object.
    
    i    i   s    func_code func_defaults func_docN(   s   reloads   modules   counts   __dict__s   itemss   names   new_objs   __name__s   keys   _old_objectss   has_keys   old_objs   types   typess	   ClassTypes   updates   FunctionTypes   update_functions   splits
   MethodTypes   im_func(   s   modules   reloads   counts   names   new_objs   keys   old_obj(    (    sR   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_autoreload.pys   superreload`   s.       	c         C   s4   t  o t i i ‚ n y t i ƒ  Wn n Xd  S(   N(   s   autoreload_enableds   IPythons   ipapis   TryNexts   reloaders   check(   s   self(    (    sR   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_autoreload.pys   runcode_hook‹   s    c           C   s
   t  a d  S(   N(   s   Trues   autoreload_enabled(    (    (    sR   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_autoreload.pys   enable_autoreload”   s     c           C   s
   t  a d  S(   N(   s   Falses   autoreload_enabled(    (    (    sR   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_autoreload.pys   disable_autoreload™   s     s    c         C   s|   | d j o t i t ƒ n[ | d j o t ƒ  nC | d j o t t _ t ƒ  n" | d j o t t _ t ƒ  n d S(   sÓ   %autoreload => Reload modules automatically

    %autoreload
    Reload all modules (except thoses excluded by %aimport) automatically now.

    %autoreload 1
    Reload all modules imported with %aimport every time before executing
    the Python code typed.

    %autoreload 2
    Reload all modules (except thoses excluded by %aimport) every time
    before executing the Python code typed.

    Reloading Python modules in a reliable way is in general
    difficult, and unexpected things may occur. Some of the common
    caveats relevant for 'autoreload' are:

    - Modules are not reloaded in any specific order, and no dependency
      analysis is done. For example, modules with 'from xxx import foo'
      retain old versions of 'foo' when 'xxx' is autoreloaded.
    - Functions or objects imported from the autoreloaded module to
      the interactive namespace are not updated.
    - C extension modules cannot be reloaded, and so cannot be
      autoreloaded.
    s    s   0s   1s   2N(   s   parameter_ss   reloaders   checks   Trues   disable_autoreloads   Falses	   check_alls   enable_autoreload(   s   selfs   parameter_s(    (    sR   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_autoreload.pys   autoreload_f¤   s     		c         C   s!  | } | om t i i ƒ  } | i ƒ  t i i ƒ  } | i ƒ  t i	 o	 d GHn d d i
 | ƒ GHd d i
 | ƒ GHn£ | i d ƒ o? | d } y t i | =Wn t j
 o n Xt t i | <nT y t i | =Wn t j
 o n Xt t i | <t | ƒ } t i h  | | <ƒ d S(   s0  %aimport => Import modules for automatic reloading.

    %aimport
    List modules to automatically import and not to import.

    %aimport foo
    Import module 'foo' and mark it to be autoreloaded for %autoreload 1

    %aimport -foo
    Mark module 'foo' to not be autoreloaded for %autoreload 1

    s%   Modules to reload:
all-expect-skippeds   Modules to reload:
%ss    s   
Modules to skip:
%ss   -i   N(   s   parameter_ss   modnames   reloaders   moduless   keyss	   to_reloads   sorts   skip_moduless   to_skips	   check_alls   joins
   startswiths   KeyErrors   Trues
   __import__s   mods   ips
   to_user_ns(   s   selfs   parameter_ss   modnames   to_skips	   to_reloads   mod(    (    sR   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_autoreload.pys	   aimport_fÉ   s2     


	
    c           C   s4   t  i d t ƒ t  i d t ƒ t  i d t ƒ d  S(   Ns
   autoreloads   aimports   pre_runcode_hook(   s   ips   expose_magics   autoreload_fs	   aimport_fs   set_hooks   runcode_hook(    (    (    sR   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_autoreload.pys   initï   s    (    s   __doc__s   times   oss	   threadings   syss   typess   imps   inspects	   tracebacks   atexits   _get_compiled_exts   PY_COMPILED_EXTs   objects   ModuleReloaders   update_functions   reloads   superreloads   reloaders   IPython.iplibs   IPythons   Falses   autoreload_enableds   runcode_hooks   enable_autoreloads   disable_autoreloads   IPython.ipapis   ipapis   gets   ips   autoreload_fs	   aimport_fs   init(   s   _get_compiled_exts   ips   runcode_hooks   atexits   IPythons	   aimport_fs   update_functions   enable_autoreloads   superreloads   imps   inits   reloaders   PY_COMPILED_EXTs   inspects   syss   ModuleReloaders   typess   disable_autoreloads   autoreload_fs	   tracebacks	   threadings   times   os(    (    sR   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_autoreload.pys   ?	   s$   Q		=	!							%&	