Ë
    i©¹d~H  ã            
       óà  — d dl Z d dlZd dlZd dlmZmZmZ d dlZd dlZd dl	Z	d dl
Z
d dlZd dlZd dlZd dlZd dlZd dlmZ d dlmZ 	 d dlmZ dZ	 d dlZ ej8                  e«       dZdZ&d„ Z'd0d„Z(d1d„Z)d„ Z*d2d„Z+d„ Z,d3d„Z-e&dddddddddf
d„Z.d3d„Z/d4d„Z0d5d„Z1e jd                  fd„Z3d„ Z4d„ Z5d„ Z6d„ Z7d „ Z8e jr                  d!œd"„Z:d#„ Z;g fd$„Z<d%„ Z G d&„ d'«      Z= G d(„ d)ej|                  «      Z? G d*„ d+e@«      ZA G d,„ d-«      ZB G d.„ d/eC«      ZDy# e$ r	 d dlmZ Y ŒÖw xY w# eef$ r>  ej@                  d	«      Z!d d
l"m#Z# dZ$e!jK                  d e#e$dd¬«      z   dz   «       Y �Œw xY w)6é    N)ÚPopenÚPIPEÚSTDOUT)Úclosing)Údeque)Úparse_version)ÚparseFTÚsos)ÚfillzÜWARNING: Failed to load 'magic' module version >= 0.4.20 which sos aims to use for detecting binary files. A less effective method will be used. It is recommended to install proper python3-magic package with the module.
ú
éH   )Úreplace_whitespacei,  c                 óÐ   — t        | d«      5 }t        j                  | «      j                  |kD  r|j	                  | d«       |j                  «       cddd«       S # 1 sw Y   yxY w)z,Returns the last number_of_bytes of filenameÚrbé   N)ÚopenÚosÚstatÚst_sizeÚseekÚread)ÚfilenameÚnumber_of_bytesÚfs      ú//usr/lib/python3/dist-packages/sos/utilities.pyÚtailr   2   sT   € ä	ˆh˜Ó	ð  Ü�7‰7�8Ó×$Ñ$ Ò6Ø�F‰F�OÐ# QÔ'Ø�v‰v‹x÷÷ ò ús   �AAÁA%c                 óü   — t        | t        «      r	 t        | |«      S t        | «      S # t        $ rI t	        j
                  d«      }|j                  d| z  «       t        t        j                  «       «      cY S w xY w)z@Returns a file-like object that can be used as a context managerr
   zfileobj: %s could not be opened)
Ú
isinstanceÚstrr   ÚIOErrorÚloggingÚ	getLoggerÚdebugr   ÚioÚStringIO)Úpath_or_fileÚmodeÚlogs      r   Úfileobjr)   :   so   € ä�,¤Ô$ð	*Ü˜ dÓ+Ð+ô �|Ó$Ð$øô ò 	*Ü×#Ñ# EÓ*ˆCØ�I‰IÐ7¸,ÑFÔGÜœ2Ÿ;™;›=Ó)Ò)ð	*ús   ’) ©AA;Á:A;c                 óŠ   — t        | «      }| |k\  rd||z  z  S | |k\  rd||z  z  S | |k\  rd||z  z  S | |k\  rd||z  z  S d| z  S )zCConverts a number of bytes to a shorter, more human friendly formatz%.1fTz%.1fGz%.1fMz%.1fKz%d)Úfloat)Úbytes_ÚKÚMÚGÚTÚfns         r   Úconvert_bytesr2   G   sm   € ä	ˆv‹€BØ�‚{Ø˜"˜q™&Ñ!Ð!Ø	�1ŠØ˜"˜q™&Ñ!Ð!Ø	�1ŠØ˜"˜q™&Ñ!Ð!Ø	�1ŠØ˜"˜q™&Ñ!Ð!à�f‰}Ðó    c                 óF  ‡— t         r@	 t        j                  | «      Šddg}‰j                  dk(  xr t	        ˆfd„|D «       «       S t        | d«      5 }	 |j                  d«       	 ddd«       y# t
        $ r Y Œ4w xY w# t        $ r Y ddd«       y	w xY w# 1 sw Y   yxY w)
az  Helper to determine if a given file contains binary content or not.

    This is especially helpful for `sos clean`, which cannot obfuscate binary
    data and instead, by default, will remove binary files.

    :param fname:   The full path of the file to check binaryness of
    :type fname:    ``str``

    :returns:   True if binary, else False
    :rtype:     ``bool``
    ztext/zinode/Úbinaryc              3   óT   •K  — | ]  }‰j                   j                  |«      –— Œ! y ­w©N)Ú	mime_typeÚ
startswith)Ú.0Ú_mtÚ_ftups     €r   ú	<genexpr>z!file_is_binary.<locals>.<genexpr>h   s    øè ø€ ÒF¸�E—O‘O×.Ñ.¨s×3ÑFùs   ƒ%(Útré   NFT)	Ú	magic_modÚmagicÚdetect_from_filenameÚencodingÚanyÚ	Exceptionr   r   ÚUnicodeDecodeError)ÚfnameÚ_mimesÚtfiler<   s      @r   Úfile_is_binaryrJ   V   sÀ   ø€ õ ð	Ü×.Ñ.¨uÓ5ˆEØ˜xÐ(ˆFà—‘ (Ñ*ò GÜÓF¸vÔFÓFð0Gðô 
ˆe�TÓ	ð ˜eð	ð �J‰J�qŒMØ÷ð øô	 ò 	Ùð	ûô "ò 	Ø÷ð ð	ú÷ð ús;   ‰>A1 ÁBÁB Á1	A=Á<A=Â 	BÂ	BÂBÂBÂB c              #   óô  K  — |rKt         j                  j                  |«      j                  t         j                  j                  «      }||z  }t        j
                  |«      D ]�  \  }}}|r1|j                  t         j                  j                  «      |k\  r|dd…= |rt        j                  ||«      sŒSt        j                  || «      D ]$  }t         j                  j                  ||«      –— Œ& Œ‘ y­w)z›Generator function to find files recursively.
    Usage::

        for filename in find("*.properties", "/var/log/foobar"):
            print filename
    N)	r   ÚpathÚdirnameÚcountÚsepÚwalkÚfnmatchÚfilterÚjoin)	Úfile_patternÚtop_dirÚ	max_depthÚpath_patternÚ
base_depthrL   ÚdirlistÚfilelistÚnames	            r   Úfindr\   x   s½   è ø€ ñ Ü—W‘W—_‘_ WÓ-×3Ñ3´B·G±G·K±KÓ@ˆ
Ø�ZÑˆ	ä#%§7¡7¨7Ó#3ò +Ñˆˆg�xÙ˜Ÿ™¤B§G¡G§K¡KÓ0°IÒ=Øš�
á¤§¡°°lÔ CØä—N‘N 8¨\Ó:ò 	+ˆDÜ—'‘'—,‘,˜t TÓ*Ó*ñ	+ñ+ùs   ‚C6C8c                 óŽ   ‡ — g }|D ]0  }t        |«      5 }|j                  ˆ fd„|D «       «       ddd«       Œ2 |S # 1 sw Y   Œ>xY w)z”Returns lines matched in fnames, where fnames can either be pathnames to
    files to grep through or open file objects to grep through line by linec              3   óP   •K  — | ]  }t        j                  ‰|«      sŒ|–— Œ y ­wr7   )ÚreÚmatch)r:   ÚlineÚpatterns     €r   r=   zgrep.<locals>.<genexpr>•   s   øè ø€ ÒK T´2·8±8¸GÀTÕ3JœDÑKùs   ƒ&Ÿ&N)r)   Úextend)rb   Úfiles_or_pathsÚmatchesÚfopÚfos   `    r   Úgreprh   Ž   s\   ø€ ð €Gàò MˆÜ�S‹\ð 	M˜RØ�N‰NÓK¨RÔKÔL÷	Mð 	MðMð €N÷	Mð 	Mús	   ”;»A	c           
      ó°  — t         j                  j                  dd«      j                  t         j                  j
                  «      }| g|D �cg c]"  }t         j                  j                  || «      ‘Œ$ c}z   }|r@||D �cg c]1  }t         j                  j                  ||j                  d«      «      ‘Œ3 c}z  }t        d„ |D «       «      S c c}w c c}w )z6Returns if a command matches an executable on the PATHÚPATHÚ ú/c              3   ód   K  — | ](  }t        j                  |t         j                  «      –— Œ* y ­wr7   )r   ÚaccessÚX_OK)r:   rL   s     r   r=   z is_executable.<locals>.<genexpr>£   s   è ø€ Ò?¨DŒr�y‰y˜œrŸw™w×'Ñ?ùs   ‚.0)	r   ÚenvironÚgetÚsplitrL   ÚpathseprS   ÚlstriprD   )ÚcommandÚsysrootÚpathsÚpÚ
candidatesÚcs         r   Úis_executabler{   š   s¦   € ô �J‰J�N‰N˜6 2Ó&×,Ñ,¬R¯W©W¯_©_Ó=€EØ�ÀÖF¸1œbŸg™gŸl™l¨1¨gÕ6ÒFÑF€JÙØØ:Dö
Ø56ŒB�G‰G�L‰L˜ !§(¡(¨3£-Õ0ò
ñ 	
ˆ
ô Ñ?°JÔ?Ó?Ð?ùò Gùò
s   Á'CÂ6Cc           
      ól  ‡‡‡	— ˆˆfd„}ˆ	fd„}t         j                  j                  «       }d|d<   |r2|j                  «       D ]  \  }}|r|||<   Œ|j	                  |d«       Œ! |rt        d«      rd|rdnd	|| fz  } t        j                  | «      }g }|D ]c  }|j                  d
«      r?d|v r;t        j                  |«      }|r|j                  |«       ŒA|j                  |«       ŒS|j                  |«       Œe |
rt        |
d«      }nt        }	 t        |d||rt        nt        d|d|¬«      }|
st!        |j"                  ||«      }nt%        ||«      }‰	r"|j&                  r, ||«       |j&                  rŒn	 |j)                  |r|nd«       |
r|j/                  «        |j5                  «       €	 |j5                  «       €Œ|j1                  «       }|j2                  }|j<                  dk(  s|j<                  dk(  rd}|j<                  ||dœS # t*        $ rJ |j-                  «        |
r|j/                  «        d|_        d|j1                  «       |j2                  dœcY S w xY w# t6        $ rA}|
r|j/                  «        |j8                  t8        j:                  k(  rdd	d	dœcY d}~S |‚d}~ww xY w)zœExecute a command and return a dictionary of status and output,
    optionally changing root or current working directory before
    executing command.
    c                  ón   •— ‰r‰dk7  rt        j                  ‰«       ‰ rt        j                  ‰ «       y y ©Nrl   )r   ÚchrootÚchdir)r€   r   s   €€r   Ú_child_prep_fnz.sos_get_command_output.<locals>._child_prep_fn±   s+   ø€ Ù�f ’mÜ�I‰I�fÔÙÜ�H‰H�U�Oð r3   c                 ó�   •—  ‰«       s| j                  «       dk(  r| j                  «        t        ‚t        j                  d«       y )Né|   ç{®Gáz„?)ÚpollÚ	terminateÚSoSTimeoutErrorÚtimeÚsleep)ÚprocÚpollers    €r   Ú_check_pollerz-sos_get_command_output.<locals>._check_poller·   s1   ø€ ÙŒ8�t—y‘y“{ cÒ)Ø�N‰NÔÜ!Ð!Ü�
‰
�4Õr3   zC.UTF-8ÚLC_ALLNÚtimeoutztimeout %s %ds %sz--foregroundrk   rl   Ú*ÚwFéÿÿÿÿT)ÚshellÚstdoutÚstderrÚbufsizeÚenvÚ	close_fdsÚ
preexec_fnrƒ   )ÚstatusÚoutputÚ	truncatedé   é~   r3   )r   rp   ÚcopyÚitemsÚpopr{   Úshlexrr   r9   Úglobrc   Úappendr   r   r   r   ÚAsyncReaderr“   Ú
FakeReaderÚrunningÚwaitrE   r†   ÚcloseÚget_contentsÚis_fullr…   ÚOSErrorÚerrnoÚENOENTÚ
returncode)ru   rŽ   r”   r   r€   r–   Ú
foregroundr5   Ú	sizelimitr‹   Úto_filer�   rŒ   Úcmd_envÚkeyÚvalueÚargsÚexpanded_argsÚargÚexpanded_argÚ_outputrx   Úreaderr“   r›   Úes      ``    `                r   Úsos_get_command_outputr¼   ¦   s’  ú€ õôô �j‰j�o‰oÓ€Gà!€GˆHÑá
ØŸ)™)›+ò 	'‰JˆC�ÙØ$�˜’à—‘˜C Õ&ð		'ñ ”= Ô+Ø%Ù(‰N¨bØØð)
ñ 
ˆô �;‰;�wÓ€Dà€MØò &ˆØ�>‰>˜#Ô 3¨#¡:ÜŸ9™9 S›>ˆLÙØ×$Ñ$ \Õ2à×$Ñ$ SÕ)à× Ñ  Õ%ð&ñ Ü�w Ó$‰äˆð,Ü�- u°WÙ#)�¬tØ '°TØ+ô-ˆñ
 Ü  §¡¨9°fÓ=‰Fä  6Ó*ˆFáØ—.’.Ù˜aÔ ð —.”.ð5ð —‘¡'‘w¨tÔ4ñ Ø�M‰MŒOð �f‰f‹hÐØð �f‰f‹hÑð ×$Ñ$Ó&ˆØ—N‘Nˆ	ð 	‡|�|�sÒ˜aŸl™l¨cÒ1Øˆð —,‘,ØØñð øô= ò 5Ø—‘”ÙØ—M‘M”Oð "'�”Ø"%°×1DÑ1DÓ1FØ%+§^¡^ñ5ò 5ð5ûô& ò ÙØ�M‰MŒOØ�7‰7”e—l‘lÒ"Ø!¨R¸bÑAÕAàˆGûðúsV   ÄA'I) Å<I) Å>H Æ3I) ÇI) ÈAI&É#I) É%I&É&I) É)	J3É24J.Ê&J3Ê,J.Ê.J3c                 óH  — | j                  d«      d   }t        | t        «       t        «       |g«      }t	        j
                  |t        j                  «      D ��cg c]  \  }}|j                  | k(  r|‘Œ }}}|r|D �cg c]  }t        ||«      sŒ|‘Œ }}|S c c}}w c c}w )a  Imports the module module_fqname and returns a list of defined classes
    from that module. If superclasses is defined then the classes returned will
    be subclasses of the specified superclass or superclasses. If superclasses
    is plural it must be a tuple of classes.ú.r‘   )	Ú
rpartitionÚ
__import__ÚglobalsÚlocalsÚinspectÚ
getmembersÚisclassÚ
__module__Ú
issubclass)Úmodule_fqnameÚsuperclassesÚmodule_nameÚmoduleÚcnameÚclass_ÚmodulesÚms           r   Úimport_modulerÐ     sŸ   € ð
  ×*Ñ*¨3Ó/°Ñ3€KÜ˜¤w£y´&³(¸[¸MÓJ€Fä×!Ñ! &¬'¯/©/Ó:÷6™-˜% à×#Ñ# }Ò4ò ð 6€Gñ 6ñ Ø%ÖE˜¬°A°|Õ)D’1ÐEˆÐEà€Nùó6ùò Fs   ÁBÁ?BÂBc                 ó&   — t        | |||¬«      d   S )zeShell out to an external command and return the output or the empty
    string in case of error.
    )rŽ   r   r€   rš   )r¼   )ÚcmdrŽ   r   Úrunats       r   Ú	shell_outrÔ   '  s$   € ô " #¨wØ)/°uô>Ø>FñHð Hr3   c                 ób   — g d¢}d}| dkD  r|dk  r|dz  }| dz  } | dkD  r|dk  rŒd|| ||   fz  S )N)ÚBÚKiBÚMiBÚGiBÚTiBr   é   é   r?   g      �@z%.*f%s© )ÚsizeÚ	precisionÚsuffixesÚsuffixindexs       r   Úget_human_readablerâ   /  sT   € â0€HØ€KØ
�Š+˜+¨š/Ø�qÑˆØ�F‰{ˆð �Š+˜+¨›/ð �y $¨°Ñ(=Ð>Ñ>Ð>r3   c                 óÔ   — |rS|t         j                  k7  r@| j                  |«      s/t         j                  j	                  || j                  d«      «      } t        ||«      } || «      S r~   )r   rO   r9   rL   rS   rt   Úgetattr)rL   rv   ÚmethodrË   Ú_meths        r   Ú_os_wrapperrç   9  sO   € Ù�7œbŸf™fÒ$Ø�‰˜wÔ'Ü—7‘7—<‘< ¨¯©°SÓ)9Ó:ˆDÜ�F˜FÓ#€EÙ�‹;Ðr3   c                 óJ   — d| v rt        | |dt        ¬«      S t        | |d«      S )Nr�   r¢   )rË   Úexists)rç   r¢   ©rL   rv   s     r   Úpath_existsrë   A  s)   € Ø
ˆd�{Ü˜4 ¨&¼Ô>Ð>Ü�t˜W hÓ/Ð/r3   c                 ó   — t        | |d«      S )NÚisdir©rç   rê   s     r   Ú
path_isdirrï   G  s   € Ü�t˜W gÓ.Ð.r3   c                 ó   — t        | |d«      S )NÚisfilerî   rê   s     r   Úpath_isfilerò   K  ó   € Ü�t˜W hÓ/Ð/r3   c                 ó   — t        | |d«      S )NÚislinkrî   rê   s     r   Úpath_islinkrö   O  ró   r3   c                 ó&   — t        | |dt        «      S )NÚlistdir)rç   r   rê   s     r   rø   rø   S  s   € Ü�t˜W i´Ó4Ð4r3   )rv   c                óâ   — |rN| j                  |«      s=t        j                  j                  || j	                  t        j
                  «      «      } t        j                  j                  | g|¢­Ž S r7   )r9   r   rL   rS   rt   rO   )rL   rv   rx   s      r   Ú	path_joinrú   W  sI   € Ù�t—‘ wÔ/Ü�w‰w�|‰|˜G T§[¡[´·±Ó%8Ó9ˆÜ�7‰7�<‰<˜Ð!˜qÒ!Ð!r3   c                 ó   — d| z   dz   S )a"  Helper to make text bold in console output, without pulling in
    dependencies to the project unneccessarily.

    :param text:    The text to make bold
    :type text:     ``str``

    :returns:       The text wrapped in the ASCII codes to display as bold
    :rtype:         ``str``
    z[1mz[0mrÝ   )Útexts    r   Úboldrý   ]  s   € ð �tÑ˜iÑ'Ð'r3   c                 ó  ‡— g }g }|j                  |«       t        | t        «      r¢| j                  «       D ]Ž  \  }Š|j	                  |«       |r||v r|j                  t        ‰«      «       Œ8t        ‰t        «      sŒI	 |j                  t        ˆfd„|D «       «      d   «       |j                  ‰j                  «       «       Œ� n|j                  | «       |D �cg c]	  }||vsŒ|‘Œ c}S # t        $ r Y ŒSw xY wc c}w )a	  Recursively compile all elements of a potentially nested dict by a set
    of keys. If a given key is a dict within ``dobj``, then _all_ elements
    within that dict, regardless of child keys, will be returned.

    For example, if a Plugin searches the devices dict for the 'storage' key,
    then all storage devices under the that dict (e.g. block, fibre, etc...)
    will be returned. However, if the Plugin specifies 'block' via ``keys``,
    then only the block devices within the devices['storage'] dict will be
    returned.

    Any elements passed here that are _not_ keys within the dict or any nested
    dicts will also be returned.

    :param dobj:    The 'top-level' dict to intially search by
    :type dobj:     ``dict``

    :param keys:    Which keys to compile elements from within ``dobj``. If no
                    keys are given, all nested elements are returned
    :param keys:    ``list`` of ``str``

    :returns:       All elements within the dict and any nested dicts
    :rtype:         ``list``
    c              3   ó2   •K  — | ]  }|‰v sŒ‰|   –— Œ y ­wr7   rÝ   )r:   r³   Úvs     €r   r=   z/recursive_dict_values_by_key.<locals>.<genexpr>‘  s    øè ø€ ò 5Ø'*°c¸Q²h˜A˜c�Fñ5ùs   ƒ	�
r   )rc   r   ÚdictrŸ   r£   Úrecursive_dict_values_by_keyÚ
IndexErrorÚkeys)Údobjr  Ú_itemsÚ_filtÚkÚdr   s         @r   r  r  j  sï   ø€ ð0 €FØ€EØ
‡M�M�$ÔÜ�$œÔØ—J‘J“Lò 	'‰DˆAˆqØ�L‰L˜ŒOá˜1 ™9Ø—‘Ô:¸1Ó=Õ>ô ˜AœtÕ$ð	à—M‘MÜ4ó 5Ø.2ô5ó àñôð —‘˜QŸV™V›XÕ&ñ%	'ð* 	�‰�dÔàÖ0�! ¨%¢ŠAÒ0Ð0øô "ò áðüò 1s   Â&C/Ã	C>Ã(C>Ã/	C;Ã:C;c                 ó   — t        | «      S )zParse the version string
    )Úversion_parse)Úversions    r   r   r      s   € ô ˜Ó!Ð!r3   c                   ó<   — e Zd ZdZd„ Zed„ «       Zd„ Zed„ «       Zy)r¥   z¾Used as a replacement AsyncReader for when we are writing directly to
    disk, and allows us to keep more simplified flows for executing,
    monitoring, and collecting command output.
    c                 ó    — || _         || _        y r7   )Úprocessr5   )Úselfr  r5   s      r   Ú__init__zFakeReader.__init__¬  s   € ØˆŒØˆ�r3   c                  ó   — y)NFrÝ   ©r  s    r   rª   zFakeReader.is_full°  s   € àr3   c                 ó"   — | j                   sdS dS )Nrk   r3   )r5   r  s    r   r©   zFakeReader.get_contents´  s   € ØŸšˆrÐ-¨#Ð-r3   c                 ó:   — | j                   j                  «       d u S r7   )r  r…   r  s    r   r¦   zFakeReader.running·  s   € à�|‰|× Ñ Ó" dÐ*Ð*r3   N)	Ú__name__rÆ   Ú__qualname__Ú__doc__r  Úpropertyrª   r©   r¦   rÝ   r3   r   r¥   r¥   ¦  s9   „ ñò
ð ñó ðò.ð ñ+ó ñ+r3   r¥   c                   ó>   ‡ — e Zd ZdZˆ fd„Zd„ Zd„ Zed„ «       Zˆ xZ	S )r¤   zÏUsed to limit command output to a given size without deadlocking
    sos.

    Takes a sizelimit value in MB, and will compile stdout from Popen into a
    string that is limited to the given sizelimit.
    c                 ó  •— t         t        | �  «        || _        || _        d| _        d | _        |r"|dz  }t        || j
                  z  «      | _        t        | j                  ¬«      | _        d| _	        | j                  «        y )Ni   é   )ÚmaxlenT)Úsuperr¤   r  Úchanr5   Ú	chunksizeÚslotsÚintr   r¦   Ústart)r  Úchannelr°   r5   Ú	__class__s       €r   r  zAsyncReader.__init__Ä  sn   ø€ ÜŒk˜4Ñ)Ô+ØˆŒ	ØˆŒØˆŒØˆŒ
ÙØ! GÑ+ˆIÜ˜Y¨¯©Ñ7Ó8ˆDŒJÜ $§*¡*Ô-ˆŒ
ØˆŒØ�
‰
�r3   c                 óØ   — 	 	 | j                   j                  | j                  «      }|sn| j                  j	                  |«       ŒD	 d| _        y# t
        t        f$ r
 Y d| _        yw xY w)al  Reads from the channel (pipe) that is the output pipe for a
        called Popen. As we are reading from the pipe, the output is added
        to a deque. After the size of the deque exceeds the sizelimit
        earlier (older) entries are removed.

        This means the returned output is chunksize-sensitive, but is not
        really byte-sensitive.
        FN)r  r   r   r   r£   Ú
ValueErrorr    r¦   )r  ra   s     r   ÚrunzAsyncReader.runÑ  sk   € ð		ØØ—y‘y—~‘~ d§n¡nÓ5�ÙàØ—
‘
×!Ñ! $Ô'ð ð ð
 ˆ�øô œGÐ$ò 	àØˆ�ð	ús   ‚AA ÁA)Á(A)c                 óþ   — | j                   r"t        j                  d«       | j                   rŒ"| j                  s"dj	                  d„ | j
                  D «       «      S dj	                  d„ | j
                  D «       «      S )z-Returns the contents of the deque as a stringr„   rk   c              3   ó@   K  — | ]  }|j                  d d«      –— Œ y­w)zutf-8ÚignoreN)Údecode©r:   Úlns     r   r=   z+AsyncReader.get_contents.<locals>.<genexpr>í  s   è ø€ ÒM¸B˜2Ÿ9™9 W¨h×7ÑMùs   ‚r3   c              3   ó    K  — | ]  }|–— Œ y ­wr7   rÝ   r-  s     r   r=   z+AsyncReader.get_contents.<locals>.<genexpr>ï  s   è ø€ Ò4 2œBÑ4ùs   ‚)r¦   rˆ   r‰   r5   rS   r   r  s    r   r©   zAsyncReader.get_contentsæ  sY   € ð �lŠlÜ�J‰J�tÔð �l‹là�{Š{Ø—7‘7ÑMÀ$Ç*Á*ÔMÓMÐMà—8‘8Ñ4¨¯©Ô4Ó4Ð4r3   c                 ó`   — | j                   syt        | j                  «      | j                   k(  S )z?Checks if the deque is full, implying that output was truncatedF)r!  Úlenr   r  s    r   rª   zAsyncReader.is_fullñ  s%   € ð �zŠzØÜ�4—:‘:‹ $§*¡*Ñ,Ð,r3   )
r  rÆ   r  r  r  r(  r©   r  rª   Ú__classcell__)r%  s   @r   r¤   r¤   ¼  s+   ø„ ñôòò*	5ð ñ-ó ô-r3   r¤   c                   ó.   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zy)ÚImporterHelperz¯Provides a list of modules that can be imported in a package.
    Importable modules are located along the module __path__ list and modules
    are files that end in .py.
    c                 ó   — || _         y)zopackage is a package module
        import my.package.module
        helper = ImporterHelper(my.package.module)N)Úpackage)r  r6  s     r   r  zImporterHelper.__init__ÿ  s   € ð ˆ�r3   c                 óˆ   — t         j                  j                  |«      }t         j                  j                  |«      \  }}|S )z-Returns the plugin module name given the path)r   rL   ÚbasenameÚsplitext)r  rL   Úbaser[   Úexts        r   Ú_plugin_namezImporterHelper._plugin_name  s3   € ä�w‰w×Ñ Ó%ˆÜ—G‘G×$Ñ$ TÓ*‰	ˆˆcØˆr3   c                 ó–   — |D �cg c](  }d|vr"|j                  d«      r| j                  |«      ‘Œ* }}|j                  «        |S c c}w )Nr  z.py)Úendswithr<  Úsort)r  Úlist_ÚpluginÚpluginss       r   Ú_get_plugins_from_listz%ImporterHelper._get_plugins_from_list  sV   € à!&öKØØ ¨Ñ.°6·?±?À5Ô3Ið ×$Ñ$ VÕ,ð Kˆð Kð 	�‰ŒØˆùò	Ks   …-Ac                 óš   — t         j                  j                  |«      r,t        t	        d|«      «      }| j                  |«      }|r|S g S y )Nz*.py)r   rL   ré   Úlistr\   rC  )r  rL   Úpy_filesÚpnamess       r   Ú_find_plugins_in_dirz#ImporterHelper._find_plugins_in_dir  sE   € Ü�7‰7�>‰>˜$ÔÜœD ¨Ó.Ó/ˆHØ×0Ñ0°Ó:ˆFÙØ�à�	ð  r3   c                 óÀ   — g }| j                   j                  D ]B  }t        j                  j	                  |«      sŒ#|j                  | j                  |«      «       ŒD |S )zQReturns the list of importable modules in the configured python
        package. )r6  Ú__path__r   rL   rí   rc   rH  )r  rB  rL   s      r   Úget_moduleszImporterHelper.get_modules  sR   € ð ˆØ—L‘L×)Ñ)ò 	@ˆDÜ�w‰w�}‰}˜TÕ"Ø—‘˜t×8Ñ8¸Ó>Õ?ð	@ð ˆr3   N)	r  rÆ   r  r  r  r<  rC  rH  rK  rÝ   r3   r   r4  r4  ù  s    „ ñò
òòòór3   r4  c                   ó   — e Zd Zd„ Zd„ Zd„ Zy)ÚTempFileUtilc                 ó    — || _         g | _        y r7   )Útmp_dirÚfiles)r  rO  s     r   r  zTempFileUtil.__init__(  s   € ØˆŒØˆ�
r3   c                 ó²   — t        j                  | j                  ¬«      \  }}t        j                  |d«      }| j
                  j                  ||f«       |S )N)Údirzw+)ÚtempfileÚmkstemprO  r   ÚfdopenrP  r£   )r  ÚfdrG   Úfobjs       r   ÚnewzTempFileUtil.new,  sE   € Ü×$Ñ$¨¯©Ô6‰	ˆˆEä�y‰y˜˜TÓ"ˆØ�
‰
×Ñ˜5 $˜-Ô(Øˆr3   c                 óä   — | j                   D ]<  \  }}	 |j                  «        |j                  «        	 t	        j
                  |«       Œ> g | _         y # t        $ r Y Œ+w xY w# t        $ r Y Œaw xY wr7   )rP  Úflushr¨   rE   r   Úunlink)r  rG   r   s      r   ÚcleanzTempFileUtil.clean3  sq   € ØŸ
™
ò 		‰HˆE�1ðØ—‘”	Ø—‘”	ðÜ—	‘	˜%Õ ð		ð ˆ�
øô ò Ùðûô ò Ùðús"   ” AµA#Á	A ÁA Á#	A/Á.A/N)r  rÆ   r  r  rX  r\  rÝ   r3   r   rM  rM  &  s   „ òòór3   rM  c                   ó   — e Zd Zy)r‡   N)r  rÆ   r  rÝ   r3   r   r‡   r‡   A  s   „ Ør3   r‡   )Úr)rÛ   r  i   @l        )NNr7   )é   NN)r   )Er   r_   rÃ   Ú
subprocessr   r   r   r!   rQ   r¬   r¡   r¢   rS  Ú	threadingrˆ   r$   Ú
contextlibr   Úcollectionsr   Úpkg_resourcesr   r  ÚSyntaxErrorÚpackaging.versionr	   r@   rA   rB   Ú__file__ÚImportErrorÚAttributeErrorr"   r(   Útextwrapr   ÚmsgÚwarningÚTIMEOUT_DEFAULTr   r)   r2   rJ   r\   rh   r{   r¼   rÐ   rÔ   râ   rL   rç   rë   rï   rò   rö   rø   rO   rú   rý   r  r¥   ÚThreadr¤   Úobjectr4  rM  r«   r‡   rÝ   r3   r   ú<module>rp     s´  ðó 
Û 	Û ß *Ñ *Û Û Û Û Û Û Û Û Û 	Ý Ý ð9Ý<ð
 €	ðGÛØ€E×Ñ˜xÔ(Ø€Ið €òó
%óòóD+ò,	ó	@ð -<ÀEØ"&¨d¸ÈØ"'°4ÀØ#(ónóbó Hó?ð /1¯g©gó ò0ò/ò0ò0ò5ð !#§¡ô "ò
(ð -/ó 31òl"÷+ñ +ô,:-�)×"Ñ"ô :-ôz*�Vô *÷Zñ ô6	�gõ 	øðM ò 9ß8ð9ûð 	�^Ð$ò GØ
ˆ'×
Ñ
˜EÓ
"€CÝð€Cð
 ‡K�K�‘t˜C ¸Ô>Ñ>ÀÑE×FðGús%   ÁD ÁD( ÄD%Ä$D%Ä(AE-Å,E-