ó
¼S]c           @@  s    d  Z  d d l m Z d d l m Z m Z d d l m Z d e e ƒ f d „  ƒ  YZ d e f d „  ƒ  YZ	 d a d	 „  Z d
 e f d „  ƒ  YZ d „  Z d S(   s!   Frontend class representing a UX.i    (   t   absolute_import(   t   ABCMetat   abstractmethod(   t   with_metaclasst   Frontendc           B@  sP   e  Z d  Z d „  Z d „  Z d „  Z d „  Z e d „  ƒ Z e d „  ƒ Z	 RS(   s-   A UX (CLI, GUI, etc.) for project operations.c         C@  s   d |  _  d |  _ d S(   s   Construct a Frontend.t    N(   t	   _info_buft
   _error_buf(   t   self(    (    s8   lib/python2.7/site-packages/anaconda_project/frontend.pyt   __init__   s    	c         C@  s}   | | } | j  d ƒ \ } } } xT | d k rx | j d ƒ rM | d  } n  | | ƒ | } | j  d ƒ \ } } } q% W| S(   Ns   
R   s   iÿÿÿÿ(   t	   partitiont   endswith(   R   t   datat   buft   line_handlert   startt   sept   end(    (    s8   lib/python2.7/site-packages/anaconda_project/frontend.pyt   _partial   s    

c         C@  s"   |  j  | |  j |  j ƒ |  _ d S(   s  Log only part of an info-level line.

        The default implementation buffers this until a line separator
        and then passes the entire line to info().
        Subtypes can override this if they want to print output
        immediately as it arrives.
        N(   R   R   t   info(   R   R   (    (    s8   lib/python2.7/site-packages/anaconda_project/frontend.pyt   partial_info)   s    c         C@  s"   |  j  | |  j |  j ƒ |  _ d S(   s  Log only part of an error-level line.

        The default implementation buffers this until a line separator
        and then passes the entire line to error().
        Subtypes can override this if they want to print output
        immediately as it arrives.
        N(   R   R   t   error(   R   R   (    (    s8   lib/python2.7/site-packages/anaconda_project/frontend.pyt   partial_error3   s    c         C@  s   d S(   s   Log an info-level message.N(    (   R   t   message(    (    s8   lib/python2.7/site-packages/anaconda_project/frontend.pyR   =   s    c         C@  s   d S(   sË   Log an error-level message.

        A rule of thumb is that if a function also returns a
        ``Status``, this message should also be appended to the
        ``errors`` field on that status.
        N(    (   R   R   (    (    s8   lib/python2.7/site-packages/anaconda_project/frontend.pyR   B   s    (
   t   __name__t
   __module__t   __doc__R	   R   R   R   R   R   R   (    (    (    s8   lib/python2.7/site-packages/anaconda_project/frontend.pyR      s   			
	
t   NullFrontendc           B@  s;   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s$   A frontend that doesn't do anything.c         C@  s   t  t |  ƒ j ƒ  d S(   s   Construct a null frontend.N(   t   superR   R	   (   R   (    (    s8   lib/python2.7/site-packages/anaconda_project/frontend.pyR	   U   s    c         C@  s   d S(   s   Part of a log message.N(    (   R   R   (    (    s8   lib/python2.7/site-packages/anaconda_project/frontend.pyR   Y   s    c         C@  s   d S(   s   Part of an error message.N(    (   R   R   (    (    s8   lib/python2.7/site-packages/anaconda_project/frontend.pyR   ]   s    c         C@  s   d S(   s   Log an info-level message.N(    (   R   R   (    (    s8   lib/python2.7/site-packages/anaconda_project/frontend.pyR   a   s    c         C@  s   d S(   s   Log an error-level message.N(    (   R   R   (    (    s8   lib/python2.7/site-packages/anaconda_project/frontend.pyR   e   s    (   R   R   R   R	   R   R   R   R   (    (    (    s8   lib/python2.7/site-packages/anaconda_project/frontend.pyR   R   s   				c           C@  s   t  d  k r t ƒ  a  n  t  S(   N(   t   _singleton_null_frontendt   NoneR   (    (    (    s8   lib/python2.7/site-packages/anaconda_project/frontend.pyt   _null_frontendm   s    t   _ErrorRecordingFrontendProxyc           B@  s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C@  s)   t  t |  ƒ j ƒ  g  |  _ | |  _ d  S(   N(   R   R    R	   t   _errorst
   underlying(   R   R"   (    (    s8   lib/python2.7/site-packages/anaconda_project/frontend.pyR	   u   s    	c         C@  s   |  j  j | ƒ d S(   s   Log an info-level message.N(   R"   R   (   R   R   (    (    s8   lib/python2.7/site-packages/anaconda_project/frontend.pyR   z   s    c         C@  s$   |  j  j | ƒ |  j j | ƒ d S(   s   Log an error-level message.N(   R!   t   appendR"   R   (   R   R   (    (    s8   lib/python2.7/site-packages/anaconda_project/frontend.pyR   ~   s    c         C@  s   |  j  } g  |  _  | S(   N(   R!   (   R   t   result(    (    s8   lib/python2.7/site-packages/anaconda_project/frontend.pyt
   pop_errorsƒ   s    		(   R   R   R	   R   R   R%   (    (    (    s8   lib/python2.7/site-packages/anaconda_project/frontend.pyR    t   s   			c         C@  s
   t  |  ƒ S(   N(   R    (   t   frontend(    (    s8   lib/python2.7/site-packages/anaconda_project/frontend.pyt   _new_error_recorder‰   s    N(   R   t
   __future__R    t   abcR   R   t#   anaconda_project.internal.metaclassR   R   R   R   R   R   R    R'   (    (    (    s8   lib/python2.7/site-packages/anaconda_project/frontend.pyt   <module>   s   B	