ó
JÉjUc           @   sî   d  Z  d d g Z d d l Z d d l Z d d l Z e j d k  rf d d l Z e j Z e j	 Z
 n  e Z e
 Z
 e j d k  r± d	 e d
 „ Z e j e d e j ƒ e j _ n  e j d k  rê d „  Z e j e d e j ƒ e j _ n  d S(   sA   Compatibility class declarations used elsewhere in the package.

t   sett	   frozensetiÿÿÿÿNi   i   i    i   t   INBOXc         C   sÑ   i  |  _  | |  _ | r! d } n d } |  j | | ƒ \ } } | d k r^ d |  _ | | f Sd |  _ d |  j  k rµ | rµ |  j d k rŸ |  j |  j  ƒ n  |  j d | ƒ ‚ n  | |  j  j d	 d
 g ƒ f S(   st  Select a mailbox.

        Flush all untagged responses.

        (typ, [data]) = <instance>.select(mailbox='INBOX', readonly=False)

        'data' is count of messages in mailbox ('EXISTS' response).

        Mandated responses are ('FLAGS', 'EXISTS', 'RECENT', 'UIDVALIDITY'), so
        other responses should be obtained via <instance>.response('FLAGS') etc.
        t   EXAMINEt   SELECTt   OKt   AUTHt   SELECTEDs	   READ-ONLYi   s   %s is not writablet   EXISTSN(	   t   untagged_responsest   is_readonlyt   _simple_commandt   statet   debugt   _dump_urt   readonlyt   gett   None(   t   selft   mailboxR   t   namet   typt   dat(    (    s=   /usr/lib/python2.7/dist-packages/getmailcore/compatibility.pyt   py25_select   s     				
	i   c         C   sh   g  } d } xL | | k  rZ |  j  j t | | d ƒ ƒ } | t | ƒ 7} | j | ƒ q Wd j | ƒ S(   s   Read 'size' bytes from remote.i    i @  t    (   t   sslobjt   readt   mint   lent   appendt   join(   R   t   sizet   chunksR   t   data(    (    s=   /usr/lib/python2.7/dist-packages/getmailcore/compatibility.pyt
   fixed_readC   s    (   i   i   i    (   i   i   i    (   i   i   i   (   t   __doc__t   __all__t   syst   imaplibt   newt   version_infot   setst   SetR    t   ImmutableSetR   t   FalseR   t   instancemethodR   t   IMAP4t   selectR"   t	   IMAP4_SSLR   (    (    (    s=   /usr/lib/python2.7/dist-packages/getmailcore/compatibility.pyt   <module>   s$   		!	