;ò
ÎÑAHc           @   sl   d  Z  d k Z e i i ƒ  Z d k Z d k Z d k l Z d „  Z	 d „  Z
 d „  Z e i d e ƒ d S(   s`    %which magic command

%which <cmd> => search PATH for files matching PATH. Also scans aliases

N(   s   fnmatchc         c   sË   t  t i i t i d i t i ƒ ƒ } d | j o d g | } n |  } xt | D]l } xc t i | ƒ D]R } t i i | ƒ \ } } | | j p t | | ƒ o t i i | | ƒ Vqi qi WqS Wd  Sd  S(   Ns   PATHs   .(   s   filters   oss   paths   isdirs   environs   splits   pathseps   fullpaths   fnames   fns   ps   listdirs   fs   splitexts   heads   exts   fnmatchs   join(   s   fnames   heads   fs   ps   exts   fullpaths   fn(    (    sM   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_which.pys   which   s    (  c         C   sâ   xÛ t  i i i ƒ  D]Ç \ } } | |  j p t | |  ƒ o q n t | ƒ o- d G| GH| i	 } | o d G| GHq q~ n | d } t  i | ƒ } | i t d ƒ d } | Gd G| GHx t | ƒ D] } d G| GHqÇ Wq Wd  S(   Ns   Callable aliass   Docstring:
i   i    s   ->s     ==(   s   ips   IPs   alias_tables   itemss   als   tgts   fnames   fnmatchs   callables   __doc__s   ds   trgs   expand_aliass   transs   splits   Nones   cmds   whichs   realcmd(   s   fnames   realcmds   ds   tgts   cmds   als   trgs   trans(    (    sM   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_which.pys   which_alias   s"     			
 c         C   s*   t  | ƒ x t | ƒ D] } | GHq Wd S(   sÑ   %which <cmd> => search PATH for files matching cmd. Also scans aliases.

    Traverses PATH and prints all files (not just executables!) that match the
    pattern on command line. Probably more useful in finding stuff
    interactively than 'which', which only prints the first matching item.
    
    Also discovers and expands aliases, so you'll see what will be executed
    when you call an alias.
    
    Example:
    
    [~]|62> %which d
    d -> ls -F --color=auto
      == c:\cygwin\bin\ls.exe
    c:\cygwin\bin\d.exe
    
    [~]|64> %which diff*
    diff3 -> diff3
      == c:\cygwin\bin\diff3.exe
    diff -> diff
      == c:\cygwin\bin\diff.exe
    c:\cygwin\bin\diff.exe
    c:\cygwin\bin\diff3.exe

    N(   s   which_aliass   args   whichs   e(   s   selfs   args   e(    (    sM   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_which.pys   which_f+   s
     
 s   which(   s   __doc__s   IPython.ipapis   IPythons   ipapis   gets   ips   oss   syss   fnmatchs   whichs   which_aliass   which_fs   expose_magic(   s   which_aliass   ips   syss   fnmatchs   which_fs   whichs   IPythons   os(    (    sM   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_which.pys   ?   s   				 