KOKINIO - MANAGER
Edit File: descriptors.cpython-312.pyc
� ���i�% � �X � d Z ddlZddlmZmZ ddlmZ ddlmZm Z ddl Z ddlmZm Z e j d� Z G d � d e j e � Z G d� deee � Z G d � deee � Z G d� de� Z G d� de� Z G d� de� Z G d� de� Z G d� d� Zy)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)�Callable� Collection� )� policyrep�util�Tc � � e Zd ZdZ ddedz deez dz deej dz ddfd�Z deddfd �Z d defd �Zdd�Z y)�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. N� name_regex�lookup_function� enum_class�returnc �p � |s|s |sJ d� �|r |rJ d� �|| _ || _ || _ || _ | y )NzQA simple attribute should be used if there is no regex, lookup function, or enum.z9Lookup functions and enum classes are mutually exclusive.)�regex� default_valuer r )�selfr r r r s �:/usr/lib64/python3.12/site-packages/setools/descriptors.py�__init__zCriteriaDescriptor.__init__: sU � � �_� � `�_� `�:�#� � H�G� H�3�!+�� �*���6E���$���� �namec � � d|� �| _ y )N� _internal_�r �r �ownerr s r �__set_name__zCriteriaDescriptor.__set_name__H s � � ���'�� r c �T � |�t �t || j | j � S �N)�AttributeError�getattrr r �r �obj�objtypes r �__get__zCriteriaDescriptor.__get__K s&