Ñò
z‰4Nc           @   s’   d  d k  Z  d  d k Z d  d k l Z d e f d „  ƒ  YZ d Z d „  Z d d „ Z	 d „  Z
 e o d	 „  Z n
 d
 „  Z d d d „ Z d S(   iÿÿÿÿN(   t   translatorst   InvalidBazFilec           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    s=   /afs/sipb.mit.edu/project/bazki/Checkout/lib/bazsvn/format.pyR      s   u   !includec         C   s:   |  i  ƒ  } t | | ƒ p t d | | f ƒ ‚ n | S(   Ns   Expected %s, got %s(   t   nextt
   isinstanceR   (   t   seqt   evtt   e(    (    s=   /afs/sipb.mit.edu/project/bazki/Checkout/lib/bazsvn/format.pyt   expect   s    c         C   sB   t  i | ƒ } | d  j	 o | i | ƒ o | Sd |  | | f S(   Ns   %s.%s%s(   R    t	   extensiont   Nonet   endswith(   t   enamet   pnamet   valuet   previoust   ext(    (    s=   /afs/sipb.mit.edu/project/bazki/Checkout/lib/bazsvn/format.pyt   default_include_name   s    c         #   s¯  d  } t } t ˆ d ƒ o ‡ ‡ f d †  } n
 d „  } ˆ i ˆ ƒ t | t i ƒ V| i ƒ  } t | t i	 ƒ o | ƒ  ‰  ˆ  oc t i
 d t ƒ Vt t i d d  d d  d t d t ƒ t i ƒ  t i ƒ  g ƒ } ‡  f d	 †  } q1| Vˆ i ˆ ƒ d  Sn- t | t i
 ƒ o	 | Vn t d
 | ƒ ‚ | i ƒ  } t | t i ƒ o¼ | i d j o• | ƒ  ‰  ˆ  oZ t i d d  d d  d t d t ƒ Vt t i ƒ  t | t i ƒ g ƒ } ‡  f d †  } q| Vt | t i ƒ Vˆ i ˆ ƒ d  Sq8t d | i ƒ ‚ n- t | t i ƒ o	 | Vn t d | ƒ ‚ ywxp| D]h} t | t i ƒ o@| ƒ  ‰  ˆ  o&x#ˆ  D]} t | t ƒ p t t | ƒ ‚ t i d d  d d  d t t f d | ƒ Vt ˆ  | t ƒ o1 t i d d  d d  d t t f d ˆ  | ƒ Vqrt ˆ  | t ƒ p t t ˆ  | ƒ ‚ t ˆ | ˆ  | ƒ } ˆ i | ˆ  | d t ƒ} t i d d  d t d t t f d | ƒ VqrWn | VPnœ t | t i ƒ pˆ t | t i ƒ o' | d  j	 o t d ˆ | f ƒ ‚ q6t | t i ƒ o' | d  j	 o t d ˆ | f ƒ ‚ q6t d | ƒ ‚ n | d  j	 o| i t j o¦ d | i j o  t d | i ˆ | f ƒ ‚ n | i i d ƒ o  t d | i ˆ | f ƒ ‚ n ˆ i | i ƒ }	 |	 d  j o  t d | i ˆ | f ƒ ‚ q.n6 | i d! j p t | i ‚ t | i i d ƒ ƒ }	 | }
 d  } | o qBn ˆ i  ˆ |
 |	 ƒ } | d  j	 oà | |	 j oÊ t | t ƒ ox | i t j o
 | i n d  } t ˆ |
 |	 | ƒ } ˆ i | | d | | j ƒ} t | _ t t f | _! | | _ n" d  | _ t t f | _! | | _ | i" d  j o d | _" qAn | VqªqBˆ d  j	 oO | i d" j p t | i ‚ ˆ t j o t d ƒ ‚ n | i } | VqBqBqBWWn£ t i# i$ j
 o‘ } | i% o: | i% i d ƒ o' | d  j	 o t d ˆ | f ƒ ‚ qU| i% o7 | i% d j o' | d  j	 o t d ˆ | f ƒ ‚ qU‚  n Xt | t i ƒ Vt | t i	 ƒ V| d  j	 o t d  ˆ | f ƒ ‚ n ˆ i ˆ ƒ d  S(#   Nt   get_new_propertiesc              s   ˆ i  ˆ  ƒ S(    (   R   (    (   t   curret   handler(    s=   /afs/sipb.mit.edu/project/bazki/Checkout/lib/bazsvn/format.pyt   <lambda>   s    c           S   s   d  S(   N(   R   (    (    (    s=   /afs/sipb.mit.edu/project/bazki/Checkout/lib/bazsvn/format.pyR      s    t   explicitt   anchort   tagt   implicitt
   flow_stylec              s   ˆ  S(    (    (    (   t   extra(    s=   /afs/sipb.mit.edu/project/bazki/Checkout/lib/bazsvn/format.pyR   1   s    s   Got %s at start of document.t    c              s   ˆ  S(    (    (    (   R   (    s=   /afs/sipb.mit.edu/project/bazki/Checkout/lib/bazsvn/format.pyR   G   s    s*   Non-empty scalar '%s' at start of mapping.s   Got %s at start of mapping.R   t   newsP   Unexpected sequence in value for %s.%s; values starting with a [ must be quoted.sO   Unexpected mapping in value for %s.%s; values starting with a { must be quoted.s   Unexpected yaml event: %st   /s<   Includes must not be in a different directory! (%s in %s.%s)s   .yamls-   Includes must not end in .yaml! (%s in %s.%s)s%   Couldn't read include '%s' for %s.%s!u   !s   utf-8s   Lines after end of file!s   but found '*'sL   Malformed alias in value for %s.%s; values starting with a * must be quoted.s!   mapping keys are not allowed heresS   Unexpected mapping key in value for %s.%s; values starting with a ? must be quoted.s   %s.%s unclosed!(   Nu   !(   Nu   !(&   R   t   Falset   hasattrt   start_elementR	   t   yamlt   StreamStartEventR   R   t   StreamEndEventt   DocumentStartEventt   itert   MappingStartEventt   Truet   MappingEndEventt   DocumentEndEventt   end_elementR   t   ScalarEventR   t   unicodet   AssertionErrort   reprt   bufferR   t   set_includet   INCLUDEt   SequenceStartEventR   R   t   get_includet   encodet   propR   t   stylet   scannert   ScannerErrort   problem(   R   R   R   t   currpt   quenchet	   get_extraR   t   pt   namet   valt   oldcurrpt   rett   oldname(    (   R   R   R   s=   /afs/sipb.mit.edu/project/bazki/Checkout/lib/bazsvn/format.pyt   parse_h   s   						 	  (  $ 						c         C   s   t  i t |  ƒ IJ|  S(   N(   t   syst   stderrR0   (   t   s(    (    s=   /afs/sipb.mit.edu/project/bazki/Checkout/lib/bazsvn/format.pyR?   ¸   s    c         C   s   |  S(    (    (   RH   (    (    s=   /afs/sipb.mit.edu/project/bazki/Checkout/lib/bazsvn/format.pyR   ¼   s    c         C   s&  | d  j o t i |  d d ƒ } n |  i d ƒ p t ‚ |  i d d ƒ d i d d ƒ d } yU t | | t i | ƒ ƒ } | o t i	 d	 „  | Dƒ | ƒ n x | D] } q­ WWng t i
 j
 oX } t i |  IJt | d
 ƒ o/ t i | i It | i ƒ IJ|  | i _ n ‚  n Xd  S(   Nt   rs   utf-8s   .yamlR   i   iÿÿÿÿt   .i    c         s   s   x |  ] } t  | ƒ Vq Wd  S(   N(   R?   (   t   .0RH   (    (    s=   /afs/sipb.mit.edu/project/bazki/Checkout/lib/bazsvn/format.pys	   <genexpr>È   s   	 t   problem_mark(   R   t   codecst   openR   R/   t   rsplitRE   R#   t   parset   emitt	   YAMLErrorRF   RG   R!   RL   t   dirR@   (   t   pathR   t   inft   outfR   t   iteratorR   t   exc(    (    s=   /afs/sipb.mit.edu/project/bazki/Checkout/lib/bazsvn/format.pyRP   À   s"    & (   RF   R#   t   bazbaseR    t	   ExceptionR   R3   R	   R   R   RE   R    R?   RP   (    (    (    s=   /afs/sipb.mit.edu/project/bazki/Checkout/lib/bazsvn/format.pyt   <module>   s   		 	