³ò
OÉcIc        ;   @   sÍ  d  Z  d d k l Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k	 Z	 d d k
 Z
 d d k Z y d d k Z Wn e j
 o n Xy d d k Z Wn e j
 o n Xy d d k Z Wn e j
 o n Xd e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d	 „  ƒ  YZ d
 e f d „  ƒ  YZ d f  d „  ƒ  YZ d e f d „  ƒ  YZ d f  d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d „  Z d f  d „  ƒ  YZ d f  d „  ƒ  YZ d f  d „  ƒ  YZ d d k Z d d k  Z  d d k! Z! d d k" Z" d d k# Z# d d k$ Z$ d d k% Z% d d k& Z& d d k' Z' d d k( Z( d d k) Z) d d k* Z* d d k+ Z+ d d k, Z, d d k- Z- d d k. Z. d d k/ Z/ d d k0 Z0 d d k+ Z+ d d k1 Z1 d d k2 Z2 d d k3 Z3 d d k4 Z4 d d k5 Z5 d d k6 Z6 d d k7 Z7 d d k8 Z8 d d k9 Z9 d d k: Z: d d k; Z; y d d k< Z< Wn e j
 o n Xe ƒ  e _= e i> i? e i= ƒ e i= e i@ d <d S(    s3   Support code for remote execution and data transferiÿÿÿÿ(   t
   generatorsNt   ConnectionErrorc           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR   !   s    t   ConnectionReadErrorc           B   s   e  Z RS(    (   R   R   (    (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR   "   s    t   ConnectionWriteErrorc           B   s   e  Z RS(    (   R   R   (    (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR   #   s    t   ConnectionQuitc           B   s   e  Z RS(    (   R   R   (    (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR   $   s    t
   Connectionc           B   s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   s4  Connection class - represent remote execution

	The idea is that, if c is an instance of this class, c.foo will
	return the object on the remote side.  For functions, c.foo will
	return a function that, when called, executes foo on the remote
	side, sending over the arguments and sending back the result.

	c         C   s
   |  i  ƒ  S(   N(   t   __str__(   t   self(    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt   __repr__0   s    c         C   s   d S(   Ns   Simple Connection(    (   R	   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR   1   s    c         C   s   d S(   Ni   (    (   R	   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt   __nonzero__2   s    (   R   R   t   __doc__R
   R   R   (    (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR   '   s   		t   LocalConnectionc           B   sM   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 RS(   sq   Local connection

	This is a dummy connection class, so that LC.foo just evaluates to
	foo using global scope.

	c         C   s   t  i p t ‚ d |  _ d S(   s.   This prevents two instances of LocalConnectioni    N(   t   Globalst   local_connectiont   AssertionErrort   conn_number(   R	   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt   __init__;   s    c         C   sJ   | t  ƒ  j o t  ƒ  | Sn( t t t ƒ o t | Sn t i | Sd  S(   N(   t   globalst
   isinstancet   __builtins__t   dictt   __dict__(   R	   t   name(    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt   __getattr__@   s
      c         C   s   | t  ƒ  | <d  S(   N(   R   (   R	   R   t   value(    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt   __setattr__E   s    c         C   s   t  ƒ  | =d  S(   N(   R   (   R	   R   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt   __delattr__G   s    c         C   s   d S(   NR   (    (   R	   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR   I   s    c         G   s   t  t | ƒ | ƒ S(   N(   t   applyt   eval(   R	   t   function_stringt   args(    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt   revalK   s    c         C   s   d  S(   N(    (   R	   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt   quitN   s    (
   R   R   R   R   R   R   R   R   R!   R"   (    (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR   4   s   						t   ConnectionRequestc           B   s    e  Z d  Z d „  Z d „  Z RS(   s.   Simple wrapper around a PipeConnection requestc         C   s   | |  _  | |  _ d  S(   N(   R   t   num_args(   R	   R   R$   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR   S   s    	c         C   s   d |  i  |  i f S(   Ns'   ConnectionRequest: %s with %d arguments(   R   R$   (   R	   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR   W   s    (   R   R   R   R   R   (    (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR#   Q   s   	t   LowLevelPipeConnectionc           B   sË   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   sß  Routines for just sending objects from one side of pipe to another

	Each thing sent down the pipe is paired with a request number,
	currently limited to be between 0 and 255.  The size of each thing
	should be less than 2^56.

	Each thing also has a type, indicated by one of the following
	characters:

	o - generic object
	i - iterator/generator of RORPs
	f - file object
	b - string
	q - quit signal
	R - RPath
	Q - QuotedRPath
	r - RORPath only
	c - PipeConnection object

	c         C   s   | |  _  | |  _ d S(   s;   inpipe is a file-type open for reading, outpipe for writingN(   t   inpipet   outpipe(   R	   R&   R'   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR   q   s    	c         C   s   d S(   sÊ   Return string version

		This is actually an important function, because otherwise
		requests to represent this object would result in "__str__"
		being executed on the other side of the connection.

		R%   (    (   R	   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR   v   s    c         C   sX  t  i i d | | ƒ t | ƒ t i j o |  i | | ƒ nt | t i	 ƒ o |  i
 | | ƒ nî t | t i ƒ o |  i | | ƒ nÇ t | t i ƒ o |  i | | ƒ n  t | t i ƒ o |  i | | ƒ ny t | d ƒ p t | d ƒ o$ t | d ƒ o |  i | | ƒ n5 t | d ƒ o |  i | | ƒ n |  i | | ƒ d S(   s5   Put an object into the pipe (will send raw if string)t   sendingt   readt   writet   closet   nextN(   t   logt   Logt   connt   typet   typest
   StringTypet   _putbufR   t
   connectionR   t   _putconnt   FilenameMappingt   QuotedRPatht
   _putqrpatht   rpatht   RPatht	   _putrpatht   RORPatht   _putrorpatht   hasattrt   _putfilet   _putitert   _putobj(   R	   t   objt   req_num(    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt   _put€   s"           c         C   s#   |  i  d t i | d ƒ | ƒ d S(   s*   Send a generic python obj down the outpipet   oi   N(   t   _writet   cPicklet   dumps(   R	   RB   RC   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyRA   Ž   s    c         C   s   |  i  d | | ƒ d S(   s    Send buffer buf down the outpipet   bN(   RF   (   R	   t   bufRC   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR3   ’   s    c         C   s&   |  i  d t t i | ƒ ƒ | ƒ d S(   s-   Send a file to the client using virtual filest   fN(   RF   t   strt   VirtualFilet   new(   R	   t   fpRC   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR?   –   s    c         C   s/   |  i  d t t i t i | ƒ ƒ ƒ | ƒ d S(   s    Put an iterator through the pipet   iN(   RF   RL   RM   RN   t   iterfilet   MiscIterToFile(   R	   t   iteratorRC   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR@   š   s    	c         C   sD   | i  i | i | i | i f } |  i d t i | d ƒ | ƒ d S(   s   Put an rpath into the pipe

		The rpath's connection will be encoded as its conn_number.  It
		and the other information is put in a tuple.

		t   Ri   N(   R/   R   t   baset   indext   dataRF   RG   RH   (   R	   R9   RC   t
   rpath_repr(    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR;   Ÿ   s    c         C   sD   | i  i | i | i | i f } |  i d t i | d ƒ | ƒ d S(   s=   Put a quoted rpath into the pipe (similar to _putrpath above)t   Qi   N(   R/   R   RU   RV   RW   RF   RG   RH   (   R	   t   qrpathRC   t   qrpath_repr(    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR8   ª   s    c         C   s5   | i  | i f } |  i d t i | d ƒ | ƒ d S(   sˆ   Put an rorpath into the pipe

		This is only necessary because if there is a .file attached,
		it must be excluded from the pickling

		t   ri   N(   RV   RW   RF   RG   RH   (   R	   t   rorpathRC   t   rorpath_repr(    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR=   °   s    c         C   s    |  i  d t | i ƒ | ƒ d S(   sœ   Put a connection into the pipe

		A pipe connection is represented just as the integer (in
		string form) of its connection number it is *connected to*.

		t   cN(   RF   RL   R   (   R	   t   pipeconnRC   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR5   º   s    c         C   s   |  i  d d d ƒ d S(   s$   Send a string that takes down servert   qt    iÿ   N(   RF   (   R	   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt   _putquitÃ   s    c      	   C   sw   yT |  i  i | t | ƒ t i t t | ƒ ƒ ƒ ƒ |  i  i | ƒ |  i  i ƒ  Wn t j
 o t	 ƒ  ‚ n Xd S(   s&   Write header and then data to the pipeN(
   R'   R*   t   chrt   Ct   long2strt   longt   lent   flusht   IOErrorR   (   R	   t
   headercharRW   RC   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyRF   Ç   s     c         C   s7   y |  i  i | ƒ SWn t j
 o t ƒ  ‚ n Xd S(   s/   Read length bytes from inpipe, returning resultN(   R&   R)   Rj   R   (   R	   t   length(    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt   _readÐ   s      c         C   sS   t  | ƒ d j p t ‚ d } x, t d ƒ D] } | d t | | ƒ } q- W| S(   s   Convert string to long inti   l    i   (   Rh   R   t   ranget   ord(   R	   t   st   lRP   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt   _s2l_oldÕ   s      c         C   sZ   d } x9 t  d ƒ D]+ } t | d ƒ \ } } t | ƒ | } q W| d j p t ‚ | S(   s   Convert long int to stringRb   i   i   i    (   Rn   t   divmodRd   R   (   R	   Rq   Rp   RP   t	   remainder(    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt   _l2s_oldÜ   s     c         C   sÆ  |  i  i d ƒ } t | ƒ d j p t d ƒ ‚ n | d t | d ƒ t i | d ƒ } } } | d j o t d ƒ ‚ n |  i | ƒ } | d j o t	 i
 | ƒ } n÷ | d	 j o
 | } nà | d
 j o t |  t | ƒ ƒ } nº | d j o" t i t |  t | ƒ ƒ ƒ } n‹ | d j o |  i | ƒ } nk | d j o |  i | ƒ } nK | d j o |  i | ƒ } n+ | d j p
 t | ‚ t i t | ƒ } t i i d | | ƒ | | f S(   s8   Read an object from the pipe and return (req_num, value)i	   s>   Truncated header string (problem probably originated remotely)i    i   i   Ra   s   Received quit signalRE   RI   RK   RP   R\   RT   RY   R_   t   received(   R&   R)   Rh   R   Ro   Re   t   str2longR   Rm   RG   t   loadsRM   t   intRQ   t   FileToMiscItert   _getrorpatht	   _getrpatht
   _getqrpathR   R   t   connection_dictR-   R.   R/   (   R	   t   header_stringt   format_stringRC   Rl   RW   t   result(    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt   _getå   s6       
 "   c         C   s%   t  i | ƒ \ } } t i | | ƒ S(   s(   Reconstruct RORPath object from raw data(   RG   Rx   R9   R<   (   R	   t   raw_rorpath_bufRV   RW   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR{   ÿ   s    c         C   s8   t  i | ƒ \ } } } } t i t i | | | | ƒ S(   s.   Return RPath object indicated by raw_rpath_buf(   RG   Rx   R9   R:   R   R~   (   R	   t   raw_rpath_bufR   RU   RV   RW   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR|     s    c         C   s8   t  i | ƒ \ } } } } t i t i | | | | ƒ S(   s)   Return QuotedRPath object from raw buffer(   RG   Rx   R6   R7   R   R~   (   R	   t   raw_qrpath_bufR   RU   RV   RW   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR}   
  s    c         C   s   |  i  i ƒ  |  i i ƒ  d S(   s.   Close the pipes associated with the connectionN(   R'   R+   R&   (   R	   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt   _close  s    (   R   R   R   R   R   RD   RA   R3   R?   R@   R;   R8   R=   R5   Rc   RF   Rm   Rr   Ru   R‚   R{   R|   R}   R†   (    (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR%   \   s,   		
								
													t   PipeConnectionc           B   sk   e  Z d  Z d d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d	 „  Z
 d
 „  Z d „  Z RS(   sL  Provide server and client functions for a Pipe Connection

	Both sides act as modules that allows for remote execution.  For
	instance, self.conn.pow(2,8) will execute the operation on the
	server side.

	The only difference between the client and server is that the
	client makes the first request, and the server listens first.

	i    c         C   sM   t  i |  | | ƒ | |  _ h  |  _ x! t d ƒ D] } d |  i | <q2 Wd S(   s  Init PipeConnection

		conn_number should be a unique (to the session) integer to
		identify the connection.  For instance, all connections to the
		client have conn_number 0.  Other connections can use this
		number to route commands to the correct process.

		i   N(   R%   R   R   t   unused_request_numbersRn   t   None(   R	   R&   R'   R   RP   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR   !  s    			  c         C   s   d |  i  S(   Ns   PipeConnection %d(   R   (   R	   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR   /  s    c         C   s–   x y |  i  ƒ  \ } } Wn7 t j
 o+ |  i d |  i ƒ  ƒ |  i ƒ  d Sn X| | j o | Sq t | t ƒ p t ‚ |  i | | ƒ q d S(   s
  Read from pipe, responding to requests until req_num.

		Sometimes after a request is sent, the other side will make
		another request before responding to the original one.  In
		that case, respond to the request.  But return once the right
		response is given.

		t   quittingN(	   R‚   R   RD   t   get_new_req_numR†   R   R#   R   t   answer_request(   R	   t   desired_req_numRC   t   object(    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt   get_response1  s    	 
	 c         C   sÀ   |  i  | =g  } xJ t | i ƒ D]9 } |  i ƒ  \ } } | | j p t ‚ | i | ƒ q  Wy, t i | | ƒ t t	 | i
 ƒ | ƒ } Wn |  i ƒ  } n X|  i | | ƒ d |  i  | <d S(   s1   Put the object requested by request down the pipeN(   Rˆ   Rn   R$   R‚   R   t   appendt   Securityt   vet_requestR   R   R   t   extract_exceptionRD   R‰   (   R	   t   requestRC   t   argument_listRP   t   arg_req_numt   argR   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyRŒ   E  s    
  c         C   s¦   t  i t i ƒ  d ƒ o ‚  n t i i d j p t i i d j oQ t i d t i ƒ  d t i ƒ  d d i t	 i
 t i ƒ  d ƒ ƒ f d ƒ n t i ƒ  d S(   s   Return active exceptioni   i   s)   Sending back exception %s of type %s: 
%si    Rb   i   (   t   robustt   is_routine_fatalt   syst   exc_infoR-   R.   t	   verbosityt   term_verbosityt   joint	   tracebackt	   format_tb(   R	   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR“   T  s    &	.c         C   s:   d t  _ t  i i |  ƒ t i d d ƒ |  i d ƒ d S(   s$   Start server's read eval return loopi   s   Starting serveri   iÿÿÿÿN(   R   t   servert   connectionsR   R-   R.   R   (   R	   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt   Server^  s    	c         G   s¾   |  i  ƒ  } |  i t | t | ƒ ƒ | ƒ x | D] } |  i | | ƒ q2 W|  i | ƒ } d |  i | <t | t ƒ o
 | ‚ n9 t | t	 ƒ o
 | ‚ n t | t
 ƒ o
 | ‚ n | Sd S(   s«   Execute command on remote side

		The first argument should be a string that evaluates to a
		function, like "pow", and the remaining are arguments to that
		function.

		N(   R‹   RD   R#   Rh   R   R‰   Rˆ   R   t	   Exceptiont
   SystemExitt   KeyboardInterrupt(   R	   R   R    RC   R—   R   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR!   e  s       
 
 
c         C   s;   |  i  p t d ƒ ‚ n |  i  i ƒ  d } |  i  | =| S(   s(   Allot a new request number and return its$   Exhaused possible connection numbersi    (   Rˆ   R   t   keys(   R	   RC   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR‹   w  s
    

c         C   s4   t  i p t ‚ |  i ƒ  |  i ƒ  |  i ƒ  d S(   s7   Close the associated pipes and tell server side to quitN(   R   R¡   R   Rc   R‚   R†   (   R	   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR"     s    

c         C   s   t  |  | ƒ S(   s.   Intercept attributes to allow for . invocation(   t   EmulateCallable(   R	   R   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR   †  s    (   R   R   R   R   R   R   RŒ   R“   R£   R!   R‹   R"   R   (    (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR‡     s   
				
				t   RedirectedConnectionc           B   s5   e  Z d  Z d d „ Z d „  Z d „  Z d „  Z RS(   s  Represent a connection more than one move away

	For instance, suppose things are connected like this: S1---C---S2.
	If Server1 wants something done by Server2, it will have to go
	through the Client.  So on S1's side, S2 will be represented by a
	RedirectedConnection.

	i    c         C   s&   | |  _  | |  _ t i | |  _ d S(   sý   RedirectedConnection initializer

		Returns a RedirectedConnection object for the given
		conn_number, where commands are routed through the connection
		with the given routing_number.  0 is the client, so the
		default shouldn't have to be changed.

		N(   R   t   routing_numberR   R~   t   routing_conn(   R	   R   Rª   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR   ”  s    			c         G   s   |  i  i d |  i | | Œ S(   s6   Evalution function_string on args on remote connectiont   RedirectedRun(   R«   R!   R   (   R	   R   R    (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR!   ¡  s    c         C   s   d |  i  |  i f S(   Ns   RedirectedConnection %d,%d(   R   Rª   (   R	   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR   ¦  s    	c         C   s   t  |  i |  i | ƒ S(   N(   t   EmulateCallableRedirectedR   R«   (   R	   R   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR   ª  s    (   R   R   R   R   R!   R   R   (    (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR©   ‹  s
   		c         G   s7   t  i |  } | t  i j	 p
 t | ‚ | i | | Œ S(   s  Run func with args on connection with conn number conn_number

	This function is meant to redirect requests from one connection to
	another, so conn_number must not be the local connection (and also
	for security reasons since this function is always made
	available).

	(   R   R~   R   R   R!   (   R   t   funcR    R/   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR¬   ®  s    	R¨   c           B   s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   s?   This is used by PipeConnection in calls like conn.os.chmod(foo)c         C   s   | |  _  | |  _ d  S(   N(   R4   R   (   R	   R4   R   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR   ¾  s    	c         G   s   t  |  i i |  i f | ƒ S(   N(   R   R4   R!   R   (   R	   R    (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt   __call__Á  s    c         C   s   t  |  i d |  i | f ƒ S(   Ns   %s.%s(   R¨   R4   R   (   R	   t	   attr_name(    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR   Ã  s    	(   R   R   R   R   R¯   R   (    (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR¨   ¼  s   		R­   c           B   s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   s=   Used by RedirectedConnection in calls like conn.os.chmod(foo)c         C   s    | | |  _  |  _ | |  _ d  S(   N(   R   R«   R   (   R	   R   R«   R   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR   É  s    c         G   s&   t  |  i i d |  i |  i f | ƒ S(   NR¬   (   R   R«   R!   R   R   (   R	   R    (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR¯   Ì  s    c         C   s#   t  |  i |  i d |  i | f ƒ S(   Ns   %s.%s(   R­   R   R«   R   (   R	   R°   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR   Ï  s    (   R   R   R   R   R¯   R   (    (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR­   Ç  s   		RM   c           B   sÑ   e  Z d  Z h  Z d Z d „  Z e e ƒ Z d „  Z e e ƒ Z d „  Z e e ƒ Z d „  Z	 e e	 ƒ Z	 d „  Z
 e e
 ƒ Z
 d „  Z e e ƒ Z d „  Z d d	 „ Z d
 „  Z d „  Z d „  Z d „  Z RS(   sä   When the client asks for a file over the connection, it gets this

	The returned instance then forwards requests over the connection.
	The class's dictionary is used by the server to associate each
	with a unique file number.

	i    c         C   s   |  i  | S(   N(   t   vfiles(   t   clst   id(    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt   getbyidà  s    c         C   s:   | d  j o |  i | i ƒ  Sn |  i | i | ƒ Sd  S(   N(   R‰   R±   R)   (   R²   R³   Rl   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt
   readfromidä  s     c         C   s   |  i  | i ƒ  S(   N(   R±   t   readline(   R²   R³   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt   readlinefromidé  s    c         C   s   |  i  | i | ƒ S(   N(   R±   R*   (   R²   R³   t   buffer(    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt	   writetoidí  s    c         C   s!   |  i  | } |  i  | =| i ƒ  S(   N(   R±   R+   (   R²   R³   RO   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt	   closebyidñ  s    
c         C   s'   |  i  } | |  i | <| d |  _  | S(   s=   Associate a new VirtualFile with a read fileobject, return idi   (   t   counterR±   (   R²   t   fileobjt   count(    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyRN   ÷  s    	c         C   s   | |  _  | |  _ d  S(   N(   R4   R³   (   R	   R4   R³   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR     s    	c         C   s   |  i  i i |  i | ƒ S(   N(   R4   RM   Rµ   R³   (   R	   Rl   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR)     s    c         C   s   |  i  i i |  i ƒ S(   N(   R4   RM   R·   R³   (   R	   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR¶     s    c         C   s   |  i  i i |  i | ƒ S(   N(   R4   RM   R¹   R³   (   R	   RJ   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR*     s    c         C   s   |  i  i i |  i ƒ S(   N(   R4   RM   Rº   R³   (   R	   (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyR+     s    c         c   s'   x  |  i  ƒ  } | p Pn | Vq d S(   s7   Iterates lines in file, like normal iter(file) behaviorN(   R¶   (   R	   t   line(    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyt   __iter__  s
     N(   R   R   R   R±   R»   R´   t   classmethodRµ   R·   R¹   Rº   RN   R   R‰   R)   R¶   R*   R+   R¿   (    (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pyRM   Ô  s*   										i    (A   R   t
   __future__R    R1   t   ost   tempfileRG   t   shutilRŸ   t   socketRš   t   gzipt   xattrt   ImportErrort   posix1et   win32securityR¤   R   R   R   R   R   R   R#   R%   R‡   R©   R¬   R¨   R­   RM   R   t   Timet   Rdifft   HardlinkR6   Re   R‘   t   Maint   rorpitert	   selectiont	   incrementt
   statisticst   managet   lazyRQ   R9   R˜   t   restoret   backupR4   t   TempFilet   SetConnectionst   librsyncR-   t   regresst   fs_abilitiest   eas_aclst
   user_groupt   comparet   win_aclsR   R¢   R   R~   (    (    (    s<   /var/lib/python-support/python2.5/rdiff_backup/connection.pys   <module>   sJ   l      ºu#	Gÿ i  