ó
gÊù]c           @   sX  d  d l  Z  d  d l Z d  d l Z d  d l m Z m Z m Z d  d l Z d Z d Z	 d Z
 d Z d e j e j e f Z d Z d	 Z d
 Z d Z d Z d Z d a d Z d Z d a d Z d Z d d g Z d a d Z d  Z d Z  g  a! d „  Z" d e# f d „  ƒ  YZ$ e$ d e% f i  ƒ Z& d e& f d „  ƒ  YZ' i  Z( d „  Z) d d „ Z* d S(   iÿÿÿÿN(   t   Utilst   Errorst   Logsi s   1.7.11t(   50f631bc5e00bdda966c68094229b99be9a21084ib   s   .wafpickle-%s-%d-%dt   APPNAMEt   VERSIONt   topt   outt   wscriptt    s   http://waf.googlecode.com/git/s   waflib/extrass   waflib/Toolsi   i    c         O   sI   x* t  D]" } | j |  k r | | | Ž  Sq Wt | | Ž  } |  | _ | S(   N(   t   classest   cmdt   Contextt   fun(   t   cmd_namet   kt   kwt   xt   ctx(    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyt   create_context   s    	t   store_contextc           B   s   e  Z d  „  Z RS(   c         C   s¨   t  t |  ƒ j | | | ƒ |  j } | d k s= | d k rA d  Sy |  j Wn$ t k
 rr t j d | ƒ ‚ n Xt |  d d  ƒ s” |  j |  _
 n  t j d |  ƒ d  S(   NR   R   s.   Missing command for the context class %r (cmd)R   i    (   t   superR   t   __init__t   __name__R   t   AttributeErrorR   t   WafErrort   getattrt   NoneR   R
   t   insert(   t   clst   namet   basest   dict(    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyR   (   s    	(   R   t
   __module__R   (    (    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyR   '   s   R   R   c           B   s°   e  Z e Z i  Z d  „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d e e d „ Z d „  Z d „  Z d d	 „ Z d
 „  Z d d „ Z d „  Z d d „ Z g  d „ Z RS(   c         K   sß   y | d } Wn t  k
 r' t } n Xd t j j f d „  ƒ  Y} | |  _ d |  j _ d |  j _ |  |  j _ |  j d d  ƒ |  _	 d  |  _
 |  j	 j | ƒ |  _ g  |  _ i |  d 6|  d 6|  d	 6|  d
 6|  _ d  |  _ d  S(   Nt   run_dirt
   node_classc           B   s   e  Z RS(    (   R   R!   (    (    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyR#   ?   s   s   waflib.Nodet   Nod3R	   R   t   conft   bldt   opt(   t   KeyErrorR"   t   waflibt   NodeR#   R!   R   R   R   t   roott
   cur_scriptt   find_dirt   patht
   stack_patht	   exec_dictt   logger(   t   selfR   t   rdR#   (    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyR   9   s    
			%c         C   s
   t  |  ƒ S(   N(   t   id(   R2   (    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyt   __hash__K   s    c   	      O   s‚   t  j | ƒ } t  j | j d d ƒ ƒ } xQ | D]I } t | | ƒ } t | | j d |  j ƒ d  ƒ } | r1 | |  ƒ q1 q1 Wd  S(   Nt   tooldirR	   R   (   R    t   to_listt   gett	   load_toolR   R   R   (	   R2   t	   tool_listR   R   t   toolsR.   t   tt   moduleR   (    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyt   loadM   s    !c         C   s#   |  j  t j j t j ƒ g ƒ d  S(   N(   t   recurset   osR.   t   dirnamet   g_modulet	   root_path(   R2   (    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyt   executeU   s    c         C   s,   |  j  j |  j ƒ | |  _ | j |  _ d  S(   N(   R/   t   appendR,   t   parentR.   (   R2   t   node(    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyt   pre_recurseX   s    	c         C   s1   |  j  j ƒ  |  _ |  j r- |  j j |  _ n  d  S(   N(   R/   t   popR,   RF   R.   (   R2   RG   (    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyt   post_recurse\   s    	c         B   sE  y |  j  } Wn e k
 r- i  } |  _  n Xxe j | ƒ D]ÿ} e j j | ƒ sw e j j |  j j ƒ  | ƒ } n  e j j | e	 ƒ } | d | pŸ |  j
 } |  j j | ƒ }	 |	 r)| sÎ |	 | k r)e | |	 <|  j |	 ƒ z0 |	 j d ƒ }
 e |
 |	 j ƒ  d ƒ |  j UWd  |  j |	 ƒ Xq> |	 s> |  j j | ƒ }	 |	 | pP|  j
 f } |	 r| so| | k re | | <|  j |	 ƒ zx e |	 j ƒ  ƒ } e | | p­|  j
 d  ƒ } | só| sÈw> n  e j d | pÝ|  j
 |	 j ƒ  f ƒ ‚ n  | |  ƒ Wd  |  j |	 ƒ Xq=|	 s=| s$q> n  e j d | ƒ ‚ q=q> q> Wd  S(   Nt   _t   rUt   execs   No function %s defined in %ss   No wscript file in directory %s(   t   recurse_cacheR   R    R7   R@   R.   t   isabst   joint   abspatht   WSCRIPT_FILER   R+   t	   find_nodet   TrueRH   t   readt   compileR0   RJ   t   load_moduleR   R   R   R   (   R2   t   dirsR   t	   mandatoryt   oncet   cachet   dt   WSCRIPTt   WSCRIPT_FUNRG   t   function_codet   tupt   wscript_modulet   user_function(    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyR?   `   sH    !
!
+c   	      K   s  t  j } t | t ƒ | d <t j d | ƒ t j d | ƒ |  j rZ |  j j | ƒ n  d | k rv | j | d <n  d | k r’ | j | d <n  yl | d s© | d rÙ | j	 | | � } | j
 ƒ  \ } } | j } n$ d \ } } | j	 | | � j ƒ  } Wn2 t k
 r2} t j d t | ƒ d | ƒ‚ n X| r™t | t ƒ sf| j t j j p]d ƒ } n  |  j r†|  j j d	 | ƒ q™t j j | ƒ n  | rÿt | t ƒ sÌ| j t j j pÃd ƒ } n  |  j rì|  j j d
 | ƒ qÿt j j | ƒ n  | S(   Nt   shells
   runner: %rs   runner_env: kw=%st   stdoutt   stderrs   Execution failure: %st   exs	   iso8859-1s   out: %ss   err: %s(   NN(   R    t
   subprocesst
   isinstancet   strR   t   debugR1   t   infot   PIPEt   Popent   communicatet
   returncodeR   t   waitt	   ExceptionR   R   t   decodet   sysRd   t   encodingt   writet   errorRe   (	   R2   R   R   Rg   t   pR   t   errt   rett   e(    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyt   exec_command‡   s@    		#		c   
      K   s;  t  j } t | t ƒ | d <t j d | ƒ d | k rM | d } | d =n d  } d | k rs | d } | d =n t } | j | d <| d <| d  k rª |  j	 | ƒ n  y( | j
 | | � } | j ƒ  \ } } Wn2 t k
 r}	 t j d t |	 ƒ d |	 ƒ‚ n Xt | t ƒ s4| j t j j p+d	 ƒ } n  t | t ƒ sa| j t j j pXd	 ƒ } n  | r“| t k r“| t k r“|  j	 d
 | ƒ n  | rÅ| t k rÅ| t k rÅ|  j	 d | ƒ n  | j rt j d | | j f ƒ }	 | j |	 _ | |	 _ | |	 _ |	 ‚ n  | t k r'| | f S| t k r7| S| S(   NRc   s
   runner: %rt   quiett   outputRd   Re   s   Execution failure: %sRf   s	   iso8859-1s   out: %ss   err: %ss   Command %r returned %r(   R    Rg   Rh   Ri   R   Rj   R   t   STDOUTRl   t   to_logRm   Rn   Rq   R   R   Rr   Rs   Rd   Rt   t   BOTHt   STDERRRo   Re   (
   R2   R   R   Rg   R|   t   to_retRw   R   Rx   Rz   (    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyt   cmd_and_log«   sL    	



#				
c         C   s€   |  j  r/ |  j  j d |  j j ƒ  | f ƒ n  y! d | |  j  j d j f } Wn t k
 rc n X|  j j | d | ƒ‚ d  S(   Ns   from %s: %ss   %s
(complete log in %s)i    Rf   (	   R1   Rk   R.   RQ   t   handlerst   baseFilenameRq   t   errorst   ConfigurationError(   R2   t   msgRf   (    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyt   fatalÔ   s    	&!c         C   sM   | s
 d  S|  j  r& |  j  j | ƒ n# t j j t | ƒ ƒ t j j ƒ  d  S(   N(   R1   Rk   Rs   Re   Ru   Ri   t   flush(   R2   Rˆ   (    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyR   Ü   s    	c         C   sE   |  j  | ƒ t | t ƒ s1 | r( d p+ d } n  |  j | | ƒ d  S(   Nt   GREENt   YELLOW(   t	   start_msgRh   Ri   t   end_msg(   R2   Rˆ   t   resultt   color(    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyRˆ   ä   s    c         C   sì   y  |  j  r |  j  d 7_  d  SWn t k
 r< d |  _  n X|  j  d 7_  y t |  j t | ƒ ƒ |  _ Wn) t k
 r– t d t | ƒ ƒ |  _ n Xx( |  j d | f D] } |  j | ƒ q« Wt j d d | j |  j ƒ d d ƒd  S(	   Ni   i    i(   t   -t   NORMALs   %s :t   sepR	   (	   t   in_msgR   t   maxt	   line_justt   lenR   R   t   pprintt   ljust(   R2   Rˆ   R   (    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyR�   é   s    	c         C   s…   |  j  d 8_  |  j  r d  Sd } | t k r7 d } n' | t k rR d } d } n t | ƒ } |  j | ƒ t j | pz | | ƒ d  S(   Ni   R‹   t   oks	   not foundRŒ   (   R”   RT   t   FalseRi   R   R   R˜   (   R2   R�   R�   t   defcolorRˆ   (    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyRŽ   ø   s    			c         C   sd   |  j  j t ƒ j d ƒ j | ƒ } x9 | D]1 } | j | k r+ t | j j d d ƒ ƒ q+ q+ Wd  S(   Ns   waflib/extrass   .pyR	   (   R+   RS   t   waf_dirt   ant_globR   R9   t   replace(   R2   t   vart   bant   lstR   (    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyt   load_special_tools  s    $N(   R   R!   R   R†   R;   R   R5   R>   RD   RH   RJ   R   RT   R?   R{   Rƒ   R‰   R   Rˆ   R�   RŽ   R£   (    (    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyR   6   s"   						'	$	)		c         B   sÏ   y e  |  SWn e k
 r n Xe j e ƒ } y e j |  d d ƒ} Wn* e e f k
 rt e	 j
 d |  ƒ ‚ n Xe j j |  ƒ } e j j d | ƒ e | |  d ƒ | j Ue j j | ƒ | e  |  <| S(   Nt   mRL   s   Could not read the file %ri    RM   (   t   cache_modulesR(   t   impt
   new_moduleRR   R    t   readft   IOErrort   OSErrorR   R   R@   R.   RA   Rs   R   RV   t   __dict__t   remove(   R.   R=   t   codet
   module_dir(    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyRW     s    
c         C   s}  |  d k r d }  n' |  d k r* d }  n |  j  d d ƒ }  | r» t | t ƒ sW t ‚ | t j t _ z, t |  ƒ t j |  } | t j	 |  <| SWd  x | D] } t j j
 | ƒ q� WXn¾ y* t j t j j t d d |  d	 ƒ ƒ Wn_ t k
 rFy* t j t j j t d d
 |  d	 ƒ ƒ Wn t k
 r8|  } qQXd |  } n Xd |  } t | ƒ t j | } | t j	 |  <| Sd  S(   Nt   javat   javawt   compiler_cct
   compiler_cs   ++t   xxR)   t   extrass   .pyt   Toolss   waflib.Tools.%ss   waflib.extras.%s(   RŸ   Rh   t   listt   AssertionErrorRs   R.   t
   __import__t   modulesR   R;   R¬   R@   t   statRP   R�   Rª   (   t   toolR6   Ry   R\   (    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyR9     s8    		
**


(+   R@   R¦   Rs   R)   R    R   R   t   waflib.Nodet
   HEXVERSIONt
   WAFVERSIONt   WAFREVISIONt   ABIt   platformt
   hexversiont   DBFILER   R   t   TOPt   OUTRR   t
   launch_dirR"   t   top_dirt   out_dirR�   t
   local_repot   remote_repot   remote_locsR   RB   R~   R�   R€   R
   R   t   typeR   t   objectR   R   R¥   RW   R9   (    (    (    sP   /git_repos/avwlv2/.waf-1.7.11-715590adb2974ef17ddee0c7e2df2d1d/waflib/Context.pyt   <module>   s@   $	Ö	