HEX
Server: nginx/1.24.0
System: Linux ip-10-50-20-85 6.5.0-1022-aws #22~22.04.1-Ubuntu SMP Fri Jun 14 16:31:00 UTC 2024 x86_64
User: usefuloffices.org (1001)
PHP: 8.1.2-1ubuntu2.23
Disabled: NONE
Upload Files
File: //usr/share/python3/debpython/__pycache__/files.cpython-310.pyc
o

��b��@s~ddlZddlmZddlmZmZmZddlmZm	Z	ddl
mZe�e
�Zddd�Zdd	d
�Zdd�Zd
d�Zdd�ZdS)�N)�walk)�abspath�isfile�join)�Popen�PIPE)�
PUBLIC_DIR_RE�z.pyccs��t|�}t|ttf�r|D]}t|�D]}|VqqdSt|�r+|�|�r+|VdStt|��D]\}}}|D]
}|�|�rEt||�Vq8q1dS)z6Generate *.py file names available in given directory.N)	�tuple�
isinstance�list�from_directoryr�endswithrrr)�dname�
extensions�item�fn�root�dirs�
file_names�r�%/usr/share/python3/debpython/files.pyr
s"���

���r
ccsj�t|�}td|dtd�}|��\}}|jdkrtd|��t|d�}|��D]
}|�|�r2|Vq(dS)z4Generate *.py file names available in given package.z/usr/bin/dpkg -L %sT)�shell�stdoutrzcannot get content of %szutf-8N)	r
rr�communicate�
returncode�	Exception�str�
splitlinesr)�package_namer�processr�stderr�linerrr�from_package.s��


��r#ccs �|D]
}|�|�r
|VqdS)z4Generate *.py file names that match given directory.N)�
startswith)�filesrrrrr�filter_directory<s�
��r&ccsb�tdd�|D��}tdd�|D��}|D]}t�|�}|r.|�d�}||vs+||vr.|VqdS)z3Generate *.py file names that match given versions.css�|]}d|VqdS)z%d.%dNr��.0�irrr�	<genexpr>Es�z filter_public.<locals>.<genexpr>css�|]	}t|d�VqdS)rN)rr'rrrr*Fs��N)�setr�match�group)r%�versions�vstr�shared_vstrr�
public_dir�versrrr�
filter_publicCs�

��r4ccs(�t|�}|D]
}|�|�s|VqdS)z<Removes files with matching extensions from given generator.N)r
r)r%rrrrr�filter_out_extOs�
��r5)r	)�logging�osr�os.pathrrr�
subprocessrr�	debpythonr�	getLogger�__name__�logr
r#r&r4r5rrrr�<module>s