3 í«„^tã@sDddlZddlZddlmZmZddlmZGdd„deeeƒZdS)éNé)Ú MatchNameÚMatchPermission)Ú PolicyQuerycs(eZdZdZ‡fdd„Zdd„Z‡ZS)Ú CommonQuerya” Query common permission sets. Parameter: policy The policy to query. Keyword Parameters/Class attributes: name The name of the common to match. name_regex If true, regular expression matching will be used for matching the name. perms The permissions to match. perms_equal If true, only commons with permission sets that are equal to the criteria will match. Otherwise, any intersection will match. perms_regex If true, regular expression matching will be used on the permission names instead of set logic. c s$tt|ƒj|f|Žtjtƒ|_dS)N)ÚsuperrÚ__init__ÚloggingZ getLoggerÚ__name__Úlog)ÚselfÚpolicyÚkwargs)Ú __class__©ú#/usr/lib64/python3.6/commonquery.pyr/szCommonQuery.__init__ccs`|jjdj|ƒƒ|j|jƒ|j|jƒx0|jjƒD]"}|j|ƒsFq6|j|ƒsRq6|Vq6WdS)z,Generator which yields all matching commons.z)Generating common results from {0.policy}N) r ÚinfoÚformatZ_match_name_debugZ_match_perms_debugr ZcommonsZ _match_nameZ _match_perms)r ZcomrrrÚresults3s    zCommonQuery.results)r Ú __module__Ú __qualname__Ú__doc__rrÚ __classcell__rr)rrrs r)r ÚreZmixinsrrZqueryrrrrrrÚs