404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.219.112.243: ~ $
3

�<�e(�@s*ddlZddlZdgZGdd�de�ZdS)�N�
DeviceMatcherc@s eZdZdZdd�Zdd�ZdS)ra,
	Device name matching against the devices specification in tuning profiles.

	The devices specification consists of multiple rules separated by spaces.
	The rules have a syntax of shell-style wildcards and are either positive
	or negative. The negative rules are prefixed with an exclamation mark.
	cs�t|t�rtjd|�}dd�|D���fdd�|D�}t��dkrL�jd�d}x�D]}tj||�rVd}PqVWx|D]}tj||�rvd}PqvW|S)	a
		Match a device against the specification in the profile.

		If there is no positive rule in the specification, implicit rule
		which matches all devices is added. The device matches if and only
		if it matches some positive rule, but no negative rule.
		z\s|,\s*cSs*g|]"}|jd�r|j�dkr|�qS)�!�)�
startswith�strip)�.0�rule�r	�$/usr/lib/python3.6/device_matcher.py�
<listcomp>sz'DeviceMatcher.match.<locals>.<listcomp>cs g|]}|�kr|dd��qS)�Nr	)rr)�positive_rulesr	r
rsr�*FT)�
isinstance�str�re�split�len�append�fnmatch)�self�rulesZdevice_nameZnegative_rulesZmatchesrr	)r
r
�matchs 



zDeviceMatcher.matchcCs,g}x"|D]}|j||�r
|j|�q
W|S)z�
		Match a device list against the specification in the profile. Returns
		the list, which is a subset of devices which match.
		)rr)rrZdevice_listZmatching_devicesZdevicer	r	r
�
match_list,s

zDeviceMatcher.match_listN)�__name__�
__module__�__qualname__�__doc__rrr	r	r	r
rs)rr�__all__�objectrr	r	r	r
�<module>s

Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 196 B 0644
__init__.cpython-36.pyc File 196 B 0644
device_matcher.cpython-36.opt-1.pyc File 1.94 KB 0644
device_matcher.cpython-36.pyc File 1.94 KB 0644
device_matcher_udev.cpython-36.opt-1.pyc File 836 B 0644
device_matcher_udev.cpython-36.pyc File 836 B 0644
inventory.cpython-36.opt-1.pyc File 4.1 KB 0644
inventory.cpython-36.pyc File 4.1 KB 0644