Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
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ú sz'DeviceMatcher.match..cs g|]}|ˆkr|dd…‘qS)éNr )rr)Úpositive_rulesr r r srÚ*FT)Ú isinstanceÚstrÚreÚsplitÚlenÚappendÚfnmatch)ÚselfÚrulesZ device_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)rrZ device_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 Ús