%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/orca/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/orca/__pycache__/ax_collection.cpython-312.pyc

�

g
f����dZdZdZdZdZdZddlZddlZejdd	�dd
l	m
Z
ddlmZdd
l
mZGd�d�Zy)a�
Utilities for obtaining objects via the collection interface.
These utilities are app-type- and toolkit-agnostic. Utilities that might have
different implementations or results depending on the type of app (e.g. terminal,
chat, web) or toolkit (e.g. Qt, Gtk) should be in script_utilities.py file(s).

N.B. There are currently utilities that should never have custom implementations
that live in script_utilities.py files. These will be moved over time.
z$Id$z
$Revision$z$Date$zCopyright (c) 2023 Igalia, S.L.�LGPL�N�Atspiz2.0)r�)�debug)�AXObjectc
�L�eZdZdZegejjgejjgejjgejjdf	d��Z	eejjfd��Zeejjfd��Z
y)�AXCollectionz=Utilities for obtaining objects via the collection interface.Fc	���tj�}	|r|D]}
|	j|
��i}|rF|D]A}|jdd�\}
}|j	dd�}|
|vr||
dz|z||
<�=|||
<�C	tj
j
|	||||||||�	}|S#t$r3}d|g}tjtj|d�Yd}~yd}~wwxYw)z4Creates a match rule based on the supplied criteria.�:rz\:z-AXCollection: Exception in create_match_rule:TN)r�StateSet�add�split�replace�	MatchRule�new�	Exceptionr�printTokens�
LEVEL_INFO)�states�state_match_type�
attributes�attribute_match_type�roles�role_match_type�
interfaces�interface_match_type�invert�	state_set�state�attributes_dict�attr�key�value�rule�error�tokenss                  �4/usr/lib/python3/dist-packages/orca/ax_collection.py�create_match_rulezAXCollection.create_match_rule5s���N�N�$�	���
%���
�
�e�$�
%����"�
1��!�Z�Z��Q�/�
��U��
�
�c�5�1���/�)�+:�3�+?�#�+E��+M�O�C�(�+0�O�C�(�

1�
	��?�?�&�&�y�'7�'6�';�',�'6�'1�';�'-�/�D�����	�E�u�M�F����e�.�.���=���	�s�:'B#�#	C�,)C�Cc���tj|�sgS|�gStj�}	tjj|||dd�}dt|��dtj�|z
d�d�}tjtj|d�|S#t$r5}d|g}tjtj|d�gcYd}~Sd}~wwxYw)	z6Returns a list of objects matching the specified rule.NrTz+AXCollection: Exception in get_all_matches:zAXCollection: z match(es) found in �.4f�s)r�supports_collection�timer�
Collection�get_matchesrrrr�len�printMessage)�objr$�order�start�matchesr%r&�msgs        r'�get_all_matcheszAXCollection.get_all_matchesbs����+�+�C�0��I��<��I��	�	���	��&�&�2�2�3��e�Q��M�G��s�7�|�n�,@�����u�AT�UX�@Y�YZ�[��
���5�+�+�S�$�7�����	�C�U�K�F����e�.�.���=��I��	�s�#B#�#	C!�,*C�C!�C!c��tj|�sy|�ytj�}	tjj|||dd�}d}|r|d}d|dtj�|z
d�d	�g}tjtj|d�|S#t$r3}d|g}tjtj|d�Yd}~yd}~wwxYw)
z5Returns the first object matching the specified rule.NrTz+AXCollection: Exception in get_first_match:rzAXCollection: foundzin r*r+)
rr,r-rr.r/rrrr)r2r$r3r4r5r%r&�matchs        r'�get_first_matchzAXCollection.get_first_matchzs����+�+�C�0���<���	�	���	��&�&�2�2�3��e�Q��M�G�����A�J�E�'��#�d�i�i�k�E�6I�#�5N�a�0P�Q��
���%�*�*�F�D�9�����	�C�U�K�F����e�.�.���=���	�s�#B!�!	C�*)C�CN)�__name__�
__module__�__qualname__�__doc__�staticmethodr�CollectionMatchType�ALL�ANYr(�CollectionSortOrder�	CANONICALr7r:��r'r	r	/s���G�
�!#�+0�+D�+D�+H�+H�%'�/4�/H�/H�/L�/L� "�*/�*C�*C�*G�*G�%'�/4�/H�/H�/L�/L�!&�)��)�X�).�)B�)B�)L�)L����.�).�)B�)B�)L�)L���rFr	)r>�__id__�__version__�__date__�
__copyright__�__license__r-�gi�require_version�
gi.repositoryr�r�	ax_objectrr	rErFr'�<module>rQsR��*�������1�
����	�����7�E�"����e�erF

Zerion Mini Shell 1.0