3 í«„^â ã @ s¤ d Z ddlZddlmZmZ ddlmZ ddlmZ G dd„ dƒZ G dd „ d e ƒZ G d d„ deƒZG dd „ d eƒZG dd„ deƒZ G dd„ deƒZG dd„ dƒZdS )zÎ SETools descriptors. These classes override how a class's attributes are get/set/deleted. This is how the @property decorator works. See https://docs.python.org/3/howto/descriptor.html for more details. é N)ÚABCÚabstractmethod)Údefaultdict)ÚWeakKeyDictionaryc @ s, e Zd ZdZd dd„Zd dd„Zdd„ ZdS )ÚCriteriaDescriptoraŽ Single item criteria descriptor. Keyword Parameters: name_regex The name of instance's regex setting attribute; used as name_regex below. If unset, regular expressions will never be used. lookup_function The name of the SELinuxPolicy lookup function, e.g. lookup_type or lookup_boolean. default_value The default value of the criteria. The default is None. enum_class The class of enumeration which supports a lookup class method. Read-only instance attribute use (obj parameter): policy The instance of SELinuxPolicy name_regex This attribute is read to determine if the criteria should be looked up or compiled into a regex. If the attribute does not exist, False is assumed. Nc C s$ || _ || _|| _|| _tƒ | _d S )N)ÚregexÚ default_valueÚlookup_functionÚ enum_classr Ú instances)ÚselfZ name_regexr r r © r ú#/usr/lib64/python3.6/descriptors.pyÚ__init__C s zCriteriaDescriptor.__init__c C s |d kr| S | j j|| jƒS )N)r Ú setdefaultr )r ÚobjÚobjtyper r r Ú__get__R s zCriteriaDescriptor.__get__c C s‚ |sd | j |<