Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib/python3.7/site-packages/logilab/common/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/logilab/common/__pycache__/__init__.cpython-37.pyc

B

�d{T��@s�dZdZddlmZddlmZdZdZdZ	Gdd	�d	e
�ZGd
d�de
�ZGdd
�d
e
�ZGdd�de
�Zddd�Zdd�Zdd�ZdS)aILogilab common library (aka Logilab's extension to the standard library).

:type STD_BLACKLIST: tuple
:var STD_BLACKLIST: directories ignored by default by the functions in
  this package which have to recurse into directories

:type IGNORED_EXTENSIONS: tuple
:var IGNORED_EXTENSIONS: file extensions that may usually be ignored
zrestructuredtext en�)�range)�version)�CVSz.svnz.hg�debian�dist�build)z.pycz.pyoz.elc�~z.swpz.origTc@seZdZdZdd�ZdS)�attrdictz>A dictionary for which keys are also accessible as attributes.cCs*y||Stk
r$t|��YnXdS)N)�KeyError�AttributeError)�self�attr�r�H/opt/alt/python37/lib/python3.7/site-packages/logilab/common/__init__.py�__getattr__,szattrdict.__getattr__N)�__name__�
__module__�__qualname__�__doc__rrrrrr	*sr	c@seZdZdd�Zdd�ZdS)�dictattrcCs
||_dS)N)�_dictattr__proxy)r�proxyrrr�__init__3szdictattr.__init__cCs.yt|j|�Stk
r(t|��YnXdS)N)�getattrrrr
)rr
rrr�__getitem__6szdictattr.__getitem__N)rrrrrrrrrr2src@s eZdZdd�Zdd�ZeZdS)�
nullobjectcCsdS)Nz<nullobject>r)rrrr�__repr__=sznullobject.__repr__cCsdS)NFr)rrrr�__bool__?sznullobject.__bool__N)rrrrr�__nonzero__rrrrr<src@s$eZdZdd�Zdd�Zdd�ZdS)�tempattrcCs||_||_||_dS)N)�objr
�value)rr r
r!rrrrDsztempattr.__init__cCs(t|j|j�|_t|j|j|j�|jS)N)rr r
�oldvalue�setattrr!)rrrr�	__enter__Isztempattr.__enter__cCst|j|j|j�dS)N)r#r r
r")r�exctyper!�	tracebackrrr�__exit__Nsztempattr.__exit__N)rrrrr$r'rrrrrCsrNcCs\|dkrg}xJ|D]B}t|ttf�r2t|||�q|dkrF|�|�q|�||��qW|S)z�Flatten a list of list with any level.

    If tr_func is not None, it should be a one argument function that'll be called
    on each final element.

    :rtype: list

    >>> flatten([1, [2, 3]])
    [1, 2, 3]
    N)�
isinstance�list�tuple�flatten�append)�iterableZtr_func�results�valrrrr+ls
r+c	Cs�g}x�|D]�}|dd�}x(tt|��D]}||t|�||<q(W|r�t|d�t|�t|�}d}xJtt|��D]:}||}x$t|�D]}|�||�|d7}q�W|d7}qvW|�|�q
W|S)a
    Given a list of lists, return a list of domain for each list to produce all
    combinations of possibles values.

    :rtype: list

    Example:

    >>> make_domains(['a', 'b'], ['c','d', 'e'])
    [['a', 'b', 'a', 'b', 'a', 'b'], ['c', 'c', 'd', 'd', 'e', 'e']]
    Nr�)r�len�insertr,)	ZlistsZdomainsr-Z
new_domain�i�missing�jr!�dummyrrr�make_domains�s 
r7cCs8x2|D]*}||kr|�|�q||kr|�|�qWdS)z`remove files/directories in the black list

    dirnames/filenames are usually from os.walk
    N)�remove)Z	blacklist�dirnames�	filenamesZnorecursrrr�_handle_blacklist�s

r;)NN)r�
__docformat__Z	six.movesrZlogilab.common.__pkginfo__r�__version__�
STD_BLACKLIST�IGNORED_EXTENSIONSZUSE_MX_DATETIME�dictr	r�objectrrr+r7r;rrrr�<module>s
)