HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //proc/1233/cwd/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