ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     
fD-  c               @   s}   d  Z  d d l Z d d l Z d d l m Z Gd d   d e j  Z Gd d   d  Z Gd d	   d	  Z d
 d   Z	 d S(   u  A class supporting chat-style (command/response) protocols.

This class adds support for 'chat' style protocols - where one side
sends a 'command', and the other sends a response (examples would be
the common internet protocols - smtp, nntp, ftp, etc..).

The handle_read() method looks at the input stream for the current
'terminator' (usually '\r\n' for single-line responses, '\r\n.\r\n'
for multi-line output), calling self.found_terminator() on its
receipt.

for example:
Say you build an async nntp client using this class.  At the start
of the connection, you'll have self.terminator set to '\r\n', in
order to process the single-line greeting.  Just before issuing a
'LIST' command you'll set it to '\r\n.\r\n'.  The output of the LIST
command will be accumulated (using your own 'collect_incoming_data'
method) up to the terminator, and then control will be returned to
you - by calling your self.found_terminator() method.
i    N(   u   dequec             B   s  |  Ee  Z d  Z d Z d Z d Z d Z d Z d' d' d d  Z	 d d   Z
 d	 d
   Z d d   Z d d   Z d d   Z d d   Z d d   Z d d   Z d d   Z d d   Z d d   Z d d   Z d d    Z d! d"   Z d# d$   Z d% d&   Z d' S((   u
   async_chatu   This is an abstract class.  You must derive from this class, and add
    the two methods collect_incoming_data() and found_terminator()i   i    u   latin-1c             C   s8   d |  _  g  |  _ t   |  _ t j j |  | |  d  S(   Ns    (   u   ac_in_bufferu   incomingu   dequeu   producer_fifou   asyncoreu
   dispatcheru   __init__(   u   selfu   socku   map(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   __init__D   s    		u   async_chat.__init__c             C   s   t  d   d  S(   Nu   must be implemented in subclass(   u   NotImplementedError(   u   selfu   data(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   collect_incoming_dataR   s    u    async_chat.collect_incoming_datac             C   s   |  j  j |  d  S(   N(   u   incomingu   append(   u   selfu   data(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   _collect_incoming_dataU   s    u!   async_chat._collect_incoming_datac             C   s&   d j  |  j  } |  j d  d   =| S(   Ns    (   u   joinu   incoming(   u   selfu   d(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu	   _get_dataX   s    u   async_chat._get_datac             C   s   t  d   d  S(   Nu   must be implemented in subclass(   u   NotImplementedError(   u   self(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   found_terminator]   s    u   async_chat.found_terminatorc             C   s:   t  | t  r- |  j r- t | |  j  } n  | |  _ d S(   uR   Set the input delimiter.  Can be a fixed string of any length, an integer, or NoneN(   u
   isinstanceu   stru   use_encodingu   bytesu   encodingu
   terminator(   u   selfu   term(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   set_terminator`   s    u   async_chat.set_terminatorc             C   s   |  j  S(   N(   u
   terminator(   u   self(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   get_terminatorf   s    u   async_chat.get_terminatorc             C   s`  y |  j  |  j  } Wn6 t j k
 rN } z |  j   d  SWYd  d  } ~ Xn Xt | t  r| |  j r| t t |  j	  } n  |  j
 | |  _
 x|  j
 r[t |  j
  } |  j   } | s |  j |  j
  d |  _
 q t | t  rh| } | | k  r"|  j |  j
  d |  _
 |  j | |  _ qX|  j |  j
 d  |   |  j
 | d   |  _
 d |  _ |  j   q t |  } |  j
 j |  } | d k r| d k r|  j |  j
 d  |   n  |  j
 | | d   |  _
 |  j   q t |  j
 |  } | r?| | k r;|  j |  j
 d  |   |  j
 | d   |  _
 n  Pq |  j |  j
  d |  _
 q Wd  S(   Ns    i    i   i(   u   recvu   ac_in_buffer_sizeu   socketu   erroru   handle_erroru
   isinstanceu   stru   use_encodingu   bytesu   encodingu   ac_in_bufferu   lenu   get_terminatoru   collect_incoming_datau   intu
   terminatoru   found_terminatoru   findu   find_prefix_at_end(   u   selfu   datau   whyu   lbu
   terminatoru   nu   terminator_lenu   index(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   handle_readn   sN    
			u   async_chat.handle_readc             C   s   |  j    d  S(   N(   u   initiate_send(   u   self(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   handle_write   s    u   async_chat.handle_writec             C   s   |  j    d  S(   N(   u   close(   u   self(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   handle_close   s    u   async_chat.handle_closec             C   s}   |  j  } t |  | k r_ xQ t d t |  |  D]$ } |  j j | | | |   q4 Wn |  j j |  |  j   d  S(   Ni    (   u   ac_out_buffer_sizeu   lenu   rangeu   producer_fifou   appendu   initiate_send(   u   selfu   datau   sabsu   i(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   push   s    	%u   async_chat.pushc             C   s   |  j  j |  |  j   d  S(   N(   u   producer_fifou   appendu   initiate_send(   u   selfu   producer(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   push_with_producer   s    u   async_chat.push_with_producerc             C   s   d S(   u4   predicate for inclusion in the readable for select()i   (    (   u   self(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   readable   s    u   async_chat.readablec             C   s   |  j  p |  j S(   u4   predicate for inclusion in the writable for select()(   u   producer_fifou	   connected(   u   self(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   writable   s    u   async_chat.writablec             C   s   |  j  j d  d S(   uA   automatically close this channel once the outgoing queue is emptyN(   u   producer_fifou   appendu   None(   u   self(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   close_when_done   s    u   async_chat.close_when_donec             C   ss  xl|  j  rn|  j rn|  j  d } | sO |  j  d =| d  k rO |  j   d  Sn  |  j } y | d  |  } WnD t k
 r | j   } | r |  j  j |  n
 |  j  d =w Yn Xt | t	  r |  j
 r t | |  j  } n  y |  j |  } Wn# t j k
 r|  j   d  SYn X| rj| t |  k  sC| t |  k  r]| | d   |  j  d <qj|  j  d =n  d  SWd  S(   Ni    (   u   producer_fifou	   connectedu   Noneu   handle_closeu   ac_out_buffer_sizeu	   TypeErroru   moreu
   appendleftu
   isinstanceu   stru   use_encodingu   bytesu   encodingu   sendu   socketu   erroru   handle_erroru   len(   u   selfu   firstu   obsu   datau   num_sent(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   initiate_send   s8    

	

	$u   async_chat.initiate_sendc             C   s*   d |  _  |  j d  d   =|  j j   d  S(   Ns    (   u   ac_in_bufferu   incomingu   producer_fifou   clear(   u   self(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   discard_buffers   s    	u   async_chat.discard_buffersN(   u   __name__u
   __module__u   __qualname__u   __doc__u   ac_in_buffer_sizeu   ac_out_buffer_sizeu   use_encodingu   encodingu   Noneu   __init__u   collect_incoming_datau   _collect_incoming_datau	   _get_datau   found_terminatoru   set_terminatoru   get_terminatoru   handle_readu   handle_writeu   handle_closeu   pushu   push_with_produceru   readableu   writableu   close_when_doneu   initiate_sendu   discard_buffers(   u
   __locals__(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu
   async_chat5   s,   D	*u
   async_chatc             B   s/   |  Ee  Z d  Z d d d  Z d d   Z d S(   u   simple_produceri   c             C   s   | |  _  | |  _ d  S(   N(   u   datau   buffer_size(   u   selfu   datau   buffer_size(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   __init__  s    	u   simple_producer.__init__c             C   se   t  |  j  |  j k rK |  j d  |  j  } |  j |  j d   |  _ | S|  j } d |  _ | Sd  S(   Ns    (   u   lenu   datau   buffer_size(   u   selfu   result(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   more  s    		u   simple_producer.moreN(   u   __name__u
   __module__u   __qualname__u   __init__u   more(   u
   __locals__(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   simple_producer  s   u   simple_producerc             B   s_   |  Ee  Z d  Z d d d  Z d d   Z d d   Z d d   Z d	 d
   Z d d   Z	 d S(   u   fifoc             C   s(   | s t    |  _ n t  |  |  _ d  S(   N(   u   dequeu   list(   u   selfu   list(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   __init__  s    u   fifo.__init__c             C   s   t  |  j  S(   N(   u   lenu   list(   u   self(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   __len__  s    u   fifo.__len__c             C   s   |  j  S(   N(   u   list(   u   self(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   is_empty  s    u   fifo.is_emptyc             C   s   |  j  d S(   Ni    (   u   list(   u   self(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   first"  s    u
   fifo.firstc             C   s   |  j  j |  d  S(   N(   u   listu   append(   u   selfu   data(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   push%  s    u	   fifo.pushc             C   s$   |  j  r d |  j  j   f Sd Sd  S(   Ni   i    (   i    N(   u   listu   popleftu   None(   u   self(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   pop(  s    	u   fifo.popN(
   u   __name__u
   __module__u   __qualname__u   Noneu   __init__u   __len__u   is_emptyu   firstu   pushu   pop(   u
   __locals__(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   fifo  s   u   fifoc             C   sE   t  |  d } x. | r@ |  j | d  |   r@ | d 8} q W| S(   Ni   (   u   lenu   endswith(   u   haystacku   needleu   l(    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   find_prefix_at_end=  s    #u   find_prefix_at_end(
   u   __doc__u   socketu   asyncoreu   collectionsu   dequeu
   dispatcheru
   async_chatu   simple_produceru   fifou   find_prefix_at_end(    (    (    u-   /opt/alt/python33/lib64/python3.3/asynchat.pyu   <module>/   s   (