
    ґ2dV                         	 d dl m Z  n# e$ r dZ Y nw xY wd dlZd dlZd dlmZmZ d dlmZ  ej	        e
          Z ej        d          Z G d d          Zd	dZdS )
    )datetimeN)PIPEPopen)dumpsz4.*?/usr/lib/python(\d(?:.\d+)?)/(site|dist)-packagesc                       e Zd Zd Zd ZdS )memoizec                 "    || _         i | _        d S N)funccache)selfr   s     (/usr/share/python3/debpython/__init__.py__init__zmemoize.__init__   s    	


    c                 z    t          ||f          }|| j        vr | j        |i || j        |<   | j        |         S r
   )r   r   r   )r   argskwargskeys       r   __call__zmemoize.__call__   sH    T6N##dj  'di888DJsOz#r   N)__name__
__module____qualname__r   r    r   r   r   r      s2              r   r   c           	      f   d||d}d}|du rn|"|                     t          t                     n|rt          |t                    rd}t	          |d          }t
          rK|                    d                    t          j                    	                                                     |                    d                    t          |                                |                                 |                     ||           t                              d	|            t          | fi |5 }|                                \  }}|o|                                 t#          |j        |ot          |d
          |ot          |d
                    cddd           S # 1 swxY w Y   dS )a6  Execute external commad.

    :param cdw: currennt working directory
    :param env: environment
    :param log_output:
        * opened log file or path to this file, or
        * None if output should be included in the returned dict, or
        * False if output should be redirectored to stdout/stderr
    F)shellcwdenvN)stdoutstderrTaz
# command executed on {}z
$ {}
zinvoking: %rzutf-8)
returncoder   r   )updater   
isinstancestropenr   writeformatnow	isoformatreprflushlogdebugr   communicateclosedictr!   )	commandr   r   
log_outputr   r/   processr   r   s	            r   executer4      s    3s33DEU		4----	 :j#&& 	/Ej#..J 	^9@@AYAYA[A[\\]]]**4==99::::j999IIng&&&	w		$		 <7 ,,..$*""$$w1!:c&'&:&:!:c&'&:&:< < << < < < < < < < < < < < < < < < < <s   5A$F&&F*-F*)NNN)r   ImportErrorloggingre
subprocessr   r   pickler   	getLoggerr   r,   compilePUBLIC_DIR_REr   r4   r   r   r   <module>r=      s   !!!!!!!   HHH  				 " " " " " " " "      g!!
RSS	 	 	 	 	 	 	 	 <  <  <  <  <  <s   	 