3 ^@szddlZddlmZmZddlmZmZmZmZGdddZ GdddZ Gd d d Z Gd d d Z Gd ddZ dS)N)CriteriaDescriptorCriteriaSetDescriptor) match_in_set match_regex match_rangematch_regex_or_setc@s,eZdZdZedZdZddZddZdS) MatchAliasz'Mixin for matching an object's aliases. alias_regexFcCs|jdj|dS)z+Emit log debugging info for alias matching.z(Alias: {0.alias}, regex: {0.alias_regex}N)debugformat)selflogr/usr/lib64/python3.6/mixins.py_match_alias_debug"szMatchAlias._match_alias_debugcCs|js dSt|j|j|jS)z Match the alias criteria Parameter: obj An object with an alias generator method named "aliases" T)aliasraliasesr )r objrrr _match_alias&szMatchAlias._match_aliasN) __name__ __module__ __qualname____doc__rrr rrrrrrr s r c@sdeZdZdZeddZdZeddZdZeddZ dZ ed d Z dZ dZ dZdZd d Zd dZdS) MatchContextaL Mixin for matching contexts. Class attributes: user The user to match in the context. user_regex If true, regular expression matching will be used on the user. role The role to match in the context. role_regex If true, regular expression matching will be used on the role. type_ The type to match in the context. type_regex If true, regular expression matching will be used on the type. range_ The range to match in the context. range_subset If true, the criteria will match if it is a subset of the context's range. range_overlap If true, the criteria will match if it overlaps any of the context's range. range_superset If true, the criteria will match if it is a superset of the context's range. range_proper If true, use proper superset/subset on range matching operations. No effect if not using set operations. user_regexZ lookup_userF role_regexZ lookup_role type_regexZ lookup_typeZ lookup_range)Zlookup_functioncCsD|jdj||jdj||jdj||jdj|dS)z-Emit log debugging info for context matching.z'User: {0.user!r}, regex: {0.user_regex}z'Role: {0.role!r}, regex: {0.role_regex}z(Type: {0.type_!r}, regex: {0.type_regex}zRange: {0.range_!r}, subset: {0.range_subset}, overlap: {0.range_overlap}, superset: {0.range_superset}, proper: {0.range_proper}N)r r )r rrrr_match_context_debug\s z!MatchContext._match_context_debugcCs|jrt|j|j|j rdS|jrsV