
Nc        	   @   s.  d  Z  d d k Z d d k Z d d k Z d d k l Z l Z d d k Z d d k l	 Z	 l
 Z
 g  Z d e	 i f d     YZ d e e
 i f d     YZ d	 e f d
     YZ d e f d     YZ d e f d     YZ d e	 i f d     YZ d e e	 i f d     YZ d e f d     YZ d S(   s   Deprecated progress reporting classes.

This module provides classes for compatibility with python-apt 0.7. They are
completely deprecated and should not be used anymore.
iN(   t   AttributeDeprecatedByt   function_deprecated_by(   t   baset   textt
   OpProgressc           B   s/   e  Z d  Z d   Z e d  Z e d  Z RS(   s7   Abstract class to implement reporting on cache opening.c         C   s>   t  i i |   d t i j o t i d t d d n d  S(   Nt   PYTHON_APT_DEPRECATION_WARNINGSs&   apt.progress.OpProgress is deprecated.t
   stackleveli   (   R   R   t   __init__t   ost   environt   warningst   warnt   DeprecationWarning(   t   self(    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyR   +   s    	t   subopt   op(   t   __name__t
   __module__t   __doc__R   R    t   subOpt   Op(    (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyR   (   s   	t   OpTextProgressc           B   s   e  Z d  Z d   Z RS(   s/   A simple text based cache open reporting class.c         C   s>   t  i i |   d t i j o t i d t d d n d  S(   NR   s*   apt.progress.OpTextProgress is deprecated.R   i   (   R   R   R   R   R	   R
   R   R   (   R   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyR   8   s    	(   R   R   R   R   (    (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyR   5   s   t   FetchProgressc           B   s   e  Z d  Z e d  \ Z Z Z Z Z h d e 6d e 6d e 6d e 6d e 6Z	 d   Z
 d   Z d	   Z d
   Z d   Z d   Z d   Z d   Z RS(   s&   Report the download/fetching progress.i   t   Donet   Queuedt   Failedt   Hitt   Ignoredc         C   sm   d |  _  d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d t i j o t	 i
 d t d d n d  S(   Ng        i    R   s)   apt.progress.FetchProgress is deprecated.R   i   (   t   etat   percentt   currentBytest   currentItemst
   totalBytest
   totalItemst
   currentCPSR   R	   R
   R   R   (   R   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyR   G   s    								c         C   s   d S(   s    Called when the fetching starts.N(    (   R   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyt   startT   s    c         C   s   d S(   s(   Called when all files have been fetched.N(    (   R   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyt   stopW   s    c         C   s   d S(   sw   Called when the status of an item changes.

        This happens eg. when the downloads fails or is completed.
        N(    (   R   t   urit   descrt   short_descrt   status(    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyt   updateStatusZ   s    c         C   s   d S(   s   Called when the status of an item changes.

        This happens eg. when the downloads fails or is completed. This
        version include information on current filesize and partial size
        N(    (   R   R%   R&   R'   R(   t	   file_sizet   partial_size(    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyt   update_status_full`   s    c         C   sc   |  i  |  i d t |  i |  i  |  _ |  i d j o$ |  i |  i  t |  i  |  _ n t S(   so   Called periodically to update the user interface.

        Return True to continue or False to cancel.
        g      Y@i    (	   R   R   t   floatR    R!   R   R"   R   t   True(   R   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyt   pulseh   s    c         C   sc   |  i  |  i d t |  i |  i  |  _ |  i d j o$ |  i |  i  t |  i  |  _ n t S(   s   Called periodically to update the user interface.
        This function includes details about the items being fetched
        Return True to continue or False to cancel.

        g      Y@i    (	   R   R   R-   R    R!   R   R"   R   R.   (   R   t   items(    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyt   pulse_itemst   s    c         C   s   d S(   s   react to media change events.N(    (   R   t   mediumt   drive(    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyt   mediaChange   s    (   R   R   R   t   ranget   dlDonet   dlQueuedt   dlFailedt   dlHitt	   dlIgnoredt   dlStatusStrR   R#   R$   R)   R,   R/   R1   R4   (    (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyR   ?   s   							t   TextFetchProgressc           B   s;   e  Z d  Z d   Z d   Z d   Z d   Z d   Z RS(   s3    Ready to use progress object for terminal windows c         C   s   t  i |   h  |  _ d  S(   N(   R   R   R0   (   R   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyR      s    c         C   s;   | |  i  j o d |  i | | f GHn | |  i | <d S(   sw   Called when the status of an item changes.

        This happens eg. when the downloads fails or is completed.
        s   %s %sN(   R7   R;   R0   (   R   R%   R&   R'   R(   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyR)      s    c         C   s   t  i |   |  i d j o> d |  i t i t |  i   t i t |  i   f } n d |  i } d | Gt	 i
 i   t S(   so   Called periodically to update the user interface.

        Return True to continue or False to cancel.
        i    s   [%2.f%%] %sB/s %ss   %2.f%% [Working]s   %s(   R   R/   R"   R   t   apt_pkgt   size_to_strt   intt   time_to_strR   t   syst   stdoutt   flushR.   (   R   t   s(    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyR/      s    	 c         C   s	   d GHd S(   s(   Called when all files have been fetched.s   Done downloading            N(    (   R   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyR$      s    c         C   s   d | | f GHt    d j S(   s   react to media change events.sS   Media change: please insert the disc labeled '%s' in the drive '%s' and press entert   ct   C(   RE   RF   (   t	   raw_input(   R   R2   R3   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyR4      s    (   R   R   R   R   R)   R/   R$   R4   (    (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyR<      s   					t   CdromProgressc           B   s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   s   Report the cdrom add progress.c         C   s.   d t  i j o t i d t d d n d  S(   NR   s)   apt.progress.CdromProgress is deprecated.R   i   (   R   R	   R
   R   R   (   R   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyR      s    	c         C   s   d S(   s   Ask for a cdrom nameN(    (   R   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyt   askCdromName   s    c         C   s   d S(   s   Change cdromN(    (   R   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyt   changeCdrom   s    c         C   s   d S(   s   Update.N(    (   R   R   t   current(    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyt   update   s    (   R   R   R   R   RI   RJ   RL   (    (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyRH      s
   			t   DumbInstallProgressc           B   sM   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 RS(   s   Report the install progress.c         C   s>   t  i i |   d t i j o t i d t d d n d  S(   NR   s-   apt.progress.*InstallProgress are deprecated.R   i   (   R   t   InstallProgressR   R   R	   R
   R   R   (   R   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyR      s    	c         C   s   t  |  d  o- t  |  d  o t i |  i d  |  _ n t  |  d  o- t  |  d  o t i |  i d  |  _ n t i i	 |   S(   Nt   writefdt   write_streamt   wt   statusfdt   status_streamt   r(
   t   hasattrR   t   fdopenRO   RP   RR   RS   R   RN   t   update_interface(   R   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyt   updateInterface   s
    !!c         C   s
   |  i    S(   N(   RX   (   R   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyRW      s    c         C   s   t  i i |   S(   N(   R   RN   t   start_update(   R   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyt   startUpdate   s    c         C   s
   |  i    S(   N(   RZ   (   R   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyRY      s    c         C   s   t  i i |   S(   N(   R   RN   t   finish_update(   R   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyt   finishUpdate   s    c         C   s
   |  i    S(   N(   R\   (   R   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyR[      s    (
   R   R   R   R   RX   RW   RZ   RY   R\   R[   (    (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyRM      s   		
				RN   c           B   s>   e  Z d  Z e d  Z d   Z d   Z d   Z d   Z RS(   s   An InstallProgress that is pretty useful.

    It supports the attributes 'percent' 'status' and callbacks for the dpkg
    errors and conffiles and status changes.
    t   select_timeoutc         C   s   t  i i |  | | |  S(   N(   R   RN   t   status_change(   R   t   pkgR   R(   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyt   statusChange   s    c         C   s   |  i  | | |  S(   N(   R`   (   R   R_   R   R(   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyR^      s    c         C   s   t  i i |   S(   N(   R   RN   t
   wait_child(   R   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyt	   waitChild   s    c         C   s
   |  i    S(   N(   Rb   (   R   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyRa      s    (	   R   R   R   R    t   selectTimeoutR`   R^   Rb   Ra   (    (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyRN      s   			t   DpkgInstallProgressc           B   s#   e  Z d  Z d Z d Z d   Z RS(   s9   Progress handler for a local Debian package installation.t    c         C   s>   | |  _  t i i |  i d  d |  _ t i i |  |  S(   s*   Start installing the given Debian package.t   _i    (	   t   debfileR   t   patht   basenamet   splitt   debnameR   RN   t   run(   R   Rg   (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyRl     s    	"(   R   R   R   Rg   Rk   Rl   (    (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyRd      s   (   R   R   RA   R=   t   apt.deprecationR    R   R
   t   apt.progressR   R   t   __all__R   R   t   objectR   R<   RH   RN   RM   Rd   (    (    (    s4   /usr/lib/python2.6/dist-packages/apt/progress/old.pyt   <module>   s   
F,#