Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib/python3.5/site-packages/pbr/hooks/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib/python3.5/site-packages/pbr/hooks/__pycache__/files.cpython-35.pyc



�Va�@smddlZddlZddlmZddlmZdd�Zdd�ZGdd	�d	ej�Z	dS)
�N)�find_package)�basecCs4d}tjjtjjtjd��r0d}|S)Nz	share/man�man)�os�path�exists�join�sys�prefix)�manpath�r�@/opt/alt/python35/lib/python3.5/site-packages/pbr/hooks/files.py�get_manpaths$rcCstjjt�d|�S)Nzman%s)rrrr)�sectionrrr
�get_man_section"srcsveZdZdZ�fdd�Z�fdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
�S)�FilesConfig�filescs;tt|�j|�||_|jjdd�|_dS)N�
data_files�)�superr�__init__�name�config�getr)�selfrr)�	__class__rr
r*s	zFilesConfig.__init__cs'|j|jd<tt|�j�dS)Nr)rrrr�save)r)rrr
r/szFilesConfig.savecs&g}x|jjd�D]�}|j�jd�r�d|kr�|jd�\}}|j�dd�}|j�}|jtjj�s�|tjj7}xmtj|�D]L\�}}|j	d�j
||��|j�fdd�|D��q�Wq|j	|�qWdj|�|_dS)	N�
�*�=�z%s = cs)g|]}dtjj�|��qS)z %s)rrr)�.0�f)�dirpathrr
�
<listcomp>@s	z,FilesConfig.expand_globs.<locals>.<listcomp>���)
r�split�rstrip�endswith�striprr�sep�walk�append�replace�extendr)r�finished�line�target�source_glob�
source_prefix�dirnames�fnamesr)r#r
�expand_globs3s!!zFilesConfig.expand_globscCsd|j|f|_dS)Nz%s
%s =)r)r�man_pathrrr
�add_man_pathFszFilesConfig.add_man_pathcCsd|j|f|_dS)Nz%s
  %s)r)r�man_pagerrr
�add_man_pageIszFilesConfig.add_man_pagecCsst�}|jd}xV|j�D]H}|j�d}|j|t��}|j|j��|||<q#W|S)N�manpagesr r%)�dict�
pbr_configr&r)r�listr,)r�man_sectionsr;�manpage�section_numberrrrr
�get_man_sectionsLs	
zFilesConfig.get_man_sectionsc	Cs|jjd|j�j�}g}xK|jd�D]:}tjj|j��r4|jt	j
|j���q4Wdj|�|jd<|j�d|j
kr|j�}xQ|j�D]C\}}t|�}|j|�x|D]}|j|�q�Wq�WdS)N�packagesrr;)rrrr)r&rr�isdirr,r�smart_find_packagesrr6r=rB�itemsrr8r:)	rrC�expanded�pkgr?r�pagesr�pagerrr
�hookVs 


zFilesConfig.hook)�__name__�
__module__�__qualname__rrrr6r8r:rBrKrr)rr
r&s
r)
rr	�pbrr�	pbr.hooksrrr�
BaseConfigrrrrr
�<module>s