+
    ^|i'                         R t ^ RIt^ RIt^ RIt^ RIHt ^RIHt ^ RIH	t	H
t
 ^ RIHt ^ RIt]P                  ! R4      tR R lt ! R	 R
]4      t ! R R]4      t ! R R4      t ! R R]4      tR# )zE
System command aliases.

Authors:

* Fernando Perez
* Brian Granger
N)Configurable)
UsageError)ListInstance)errorz^(\s*)()(\S+)(.*$)c                    V ^8  d   QhR\         P                  \         P                  \        \        3,          ,          /# )   return)tr   Tuplestr)formats   "4/usr/lib/python3/dist-packages/IPython/core/alias.py__annotate__r   +   s,     F FS 12 F    c                    \         P                  R8X  d   . ROp \        P                  P	                  R4      '       d   . ROpMS\        P                  P	                  R4      '       g&   \        P                  P	                  R4      '       d   . ROpM. ROpW,           p V # \         P                  R	9   d   . R
Op V # . p V # )z1Return list of shell aliases to auto-define.
    posixlinuxopenbsdnetbsd)mkdirr   rmdirr   )mvr   )rmr   )cpr   )catr   ))lszls -F --color)llzls -F -o --color)lfzls -F -o --color %l | grep ^-)lkzls -F -o --color %l | grep ^l)ldirzls -F -o --color %l | grep /$)lxz ls -F -o --color %l | grep ^-..x))r   zls -F)r   zls -F -l)r    zls -F -l %l | grep ^-)r!   zls -F -l %l | grep ^l)r"   zls -F -l %l | grep /$)r#   zls -F -l %l | grep ^-..x))r   zls -F -G)r   zls -F -l -G)r    zls -F -l -G %l | grep ^-)r!   zls -F -l -G %l | grep ^l)r"   zls -F -G -l %l | grep /$)r#   zls -F -l -G %l | grep ^-..x)ntdos))r   zdir /on)ddirdir /ad /on)r"   r'   r   r   )echor(   )renr)   )copyr*   )osnamesysplatform
startswith)default_aliases
ls_aliasess     r   r0   r0   +   s     
ww' <<""7++J \\$$Y//3<<3J3J83T3TJJ *6  
M	!  r   c                       ] tR t^ttRtR# )
AliasError N__name__
__module____qualname____firstlineno____static_attributes__r4   r   r   r3   r3   t       r   r3   c                       ] tR t^xtRtR# )InvalidAliasErrorr4   Nr5   r4   r   r   r=   r=   x   r;   r   r=   c                   H   a  ] tR t^|t o Rt0 RmtR tR tR tR	R lt	Rt
V tR# )
AliaszxCallable object storing the details of one alias.

Instances are registered as magic functions to allow use of aliases.
c                    Wn         W n        W0n        R P                  V4      V n        V P                  4       V n        R# )zAlias for `!{}`N)shellr,   cmdr   __doc__validatenargs)selfrA   r,   rB   s   &&&&r   __init__Alias.__init__   s0    
	(//4]]_
r   c                   V P                   V P                  9   d   \        RV P                   ,          4      h V P                  P                  P
                  R,          V P                   ,          p\        V\        4      '       g   \        RV P                   ,          4      h \        V P                  \        4      '       g   \        RV P                  ,          4      hV P                  P                  R4      V P                  P                  R4      ,
          pV^ 8  d,   V P                  P                  R4      ^ 8  d   \        R4      hV#   \         d     Li ; i)	z7Validate the alias, and return the number of arguments.z@The name %s can't be aliased because it is a keyword or builtin.linezAThe name %s can't be aliased because it is another magic command.z*An alias command must be a string, got: %r%s%%s%lzEThe %s and %l specifiers are mutually exclusive in alias definitions.)r,   	blacklistr=   rA   magics_managermagics
isinstancer?   KeyErrorrB   r   countfind)rF   callerrE   s   &  r   rD   Alias.validate   s7   99&# %JLPII%V W W	\ZZ..55f=diiHF fe,,' )OQUQZQZ)[ \ \ - 488S))# %.04%9 : : t$txx~~e'<<AIDHHMM$/14# %F G G #  		s   8E EEc                N    R P                  V P                  V P                  4      # )z<alias {} for {!r}>)r   r,   rB   )rF   s   &r   __repr__Alias.__repr__   s    $++DIItxx@@r   c           
     &   V P                   pV P                  pVP                  R 4      ^ 8  d   VP                  R V4      pRpV^ 8X  d3   VP                  R4      ^8  d   VP                  RR4      pV: RV: 2pMzVP	                  RV4      p\        V4      V8  d,   \        RV P                  : RV: R\        V4      : R	24      hV\        VRV 4      ,          : RRP                  WCR 4      : 2pV P                  P                  V4       R# )
rM    rL   rK    NzAlias <z> requires z arguments, z given.)rB   rE   rT   replacesplitlenr   r,   tuplejoinrA   system)rF   restrB   rE   argss   &&   r   __call__Alias.__call__   s    hh

88D>Q++dD)CD!8xx!#kk%. $'C ::dE*D4y5  yy%T"4 5 5 5fu#666sxxV7MNC

#r   )rC   rB   r,   rE   rA   N>   cdpopdaliasdhistpushdunalias)r[   )r6   r7   r8   r9   rC   rN   rG   rD   rX   re   r:   __classdictcell__)__classdict__s   @r   r?   r?   |   s,      @I%4A r   r?   c                     a a ] tR t^t o]! ]! 4       4      P                  RR7      t]! . R7      P                  RR7      t]! RRR7      t	RV 3R llt
R t]R 4       tR	 tR
 tR tR tR tR tR tV3R ltRtVtV ;t# )AliasManagerT)config)default_valuez1IPython.core.interactiveshell.InteractiveShellABC)
allow_nonec                   < \         \        V `
  ! RR V/VB  V P                  e?   V P                  P                  P
                  R,          V n        V P                  4        R# R# )rA   NrJ   r4   )superrp   rG   rA   rO   rP   
linemagicsinit_aliases)rF   rA   kwargs	__class__s   &&,r   rG   AliasManager.__init__   sQ    lD*AA&A::!"jj77>>vFDO "r   c                   V P                   V P                  ,            Fh  w  rVP                  R 4      '       d<   V P                  e.   V P                  P                  R8X  d   VP                  RR4      pV P                  W4       Kj  	  R# )zls Nnocolorz --colorr[   )r0   user_aliasesr/   rA   colorsr]   soft_define_alias)rF   r,   rB   s   &  r   rw   AliasManager.init_aliases   sl    --0A0AAAIDu%%JJ*JJ%%2kk*b1""4- Br   c                    V P                   P                  4        UUu. uF*  w  r\        V\        4      '       g   K  WP                  3NK,  	  upp# u uppi N)rv   itemsrQ   r?   rB   )rF   nfuncs   &  r   aliasesAliasManager.aliases   sH    /3/D/D/F 8/F)1)$6 HH/F 8 	8 8s
   AAc                     V P                  W4       R#   \         d   p\        RT,          4        Rp?R# Rp?ii ; i)z2Define an alias, but don't raise on an AliasError.zInvalid alias: %sN)define_aliasr3   r   )rF   r,   rB   es   &&& r   r   AliasManager.soft_define_alias   s6    	+d( 	+%)**	+s    =8=c                    \        V P                  WR7      pV P                  P                  P                  VRVR7       R# )zpDefine a new alias after validating it.

This will raise an :exc:`AliasError` if there are validation
problems.
)rA   r,   rB   rJ   )
magic_kind
magic_nameN)r?   rA   rO   register_function)rF   r,   rB   rU   s   &&& r   r   AliasManager.define_alias   s9     TZZd<

!!33Fv?C 	4 	Er   c                n    V P                   P                  VR4      p\        V\        4      '       d   V# R# )z9Return an alias, or None if no alias by that name exists.N)rv   getrQ   r?   )rF   r,   anames   && r   	get_aliasAliasManager.get_alias   s/    ##D$/"5%00u:d:r   c                (    V P                  V4      RJ# )z?Return whether or not a given name has been defined as an aliasN)r   rF   r,   s   &&r   is_aliasAliasManager.is_alias   s    ~~d#4//r   c                r    V P                  V4      '       d   V P                  V R# \        R V,          4      h)%s is not an aliasN)r   rv   
ValueErrorr   s   &&r   undefine_aliasAliasManager.undefine_alias   s.    ==%1D899r   c                R    V P                    F  w  rV P                  V4       K  	  R # r   )r   r   )rF   r,   _s   &  r   clear_aliasesAliasManager.clear_aliases  s     ||GD% $r   c                p    V P                  V4      pV'       d   VP                  # \        RV,          4      h)z/Retrieve the command to which an alias expands.r   )r   rB   r   )rF   r,   rU   s   && r   retrieve_aliasAliasManager.retrieve_alias  s.    %::1D899r   c                2   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   # )r   r0   r}   )r   )r   rn   s   "r   r   AliasManager.__annotate__   s     D @ r   )rv   r   )r6   r7   r8   r9   r   r0   tagr}   r   rA   rG   rw   propertyr   r   r   r   r   r   r   r   __annotate_func__r:   rm   __classcell__)ry   rn   s   @@r   rp   rp      s      !2377t7DOB/3343@L;E 	. 8 8+E;
0:&:E  r   rp   )rC   r+   rer-   traitlets.config.configurabler   r   r   	traitletsr   r   loggingtypingr
   compileshell_line_splitr0   	Exceptionr3   r=   r?   rp   r4   r   r   <module>r      sp   * 
 	 
 6  $   ::34 FR	 		
 	B BPH:< H:r   