%PDF- %PDF-
Direktori : /usr/lib/python3/dist-packages/orca/__pycache__/ |
Current File : //usr/lib/python3/dist-packages/orca/__pycache__/ax_utilities_collection.cpython-312.pyc |
� g f� � � � d Z dZdZdZdZdZddlZddlZddlZ ej dd � dd l mZ ddlm Z dd lmZ ddlmZ ddlmZ ddlmZ G d� d� Zy)a� Utilities for finding all objects that meet a certain criteria. 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)�AXCollection)�AXObject)�AXUtilitiesRole)�AXUtilitiesStatec � � e Zd ZdZed� � Zed�d�� Zed�d�� Zed�d�� Zed�d�� Z ed�d�� Z ed�d �� Zed�d �� Zed�d�� Z ed�d�� Zed�d �� Zed�d�� Zed�d�� Zed�d�� Zed�d�� Zed�d�� Zed�d�� Zed�d�� Zed�d�� Zed�d�� Zed�d�� Zed�d�� Zed�d�� Zed�d�� Zed�d�� Zed�d�� Zed�d�� Zed�d�� Z ed�d�� Z!ed�d �� Z"ed�d!�� Z#ed�d"�� Z$ed�d#�� Z%ed�d$�� Z&ed�d%�� Z'ed�d&�� Z(ed�d'�� Z)ed�d(�� Z*ed�d)�� Z+ed�d*�� Z,ed�d+�� Z-ed�d,�� Z.ed�d-�� Z/ed�d.�� Z0ed�d/�� Z1ed�d0�� Z2ed�d1�� Z3ed�d2�� Z4ed�d3�� Z5ed�d4�� Z6ed�d5�� Z7ed�d6�� Z8ed�d7�� Z9ed�d8�� Z:ed�d9�� Z;ed�d:�� Z<ed�d;�� Z=ed�d<�� Z>ed�d=�� Z?ed�d>�� Z@ed�d?�� ZAed�d@�� ZBed�dA�� ZCed�dB�� ZDed�dC�� ZEed�dD�� ZFed�dE�� ZGed�dF�� ZHed�dG�� ZIed�dH�� ZJed�dI�� ZKed�dJ�� ZLed�dK�� ZMed�dL�� ZNed�dM�� ZOed�dN�� ZPed�dO�� ZQed�dP�� ZRed�dQ�� ZSed�dR�� ZTed�dS�� ZUed�dT�� ZVed�dU�� ZWed�dV�� ZXed�dW�� ZYed�dX�� ZZed�dY�� Z[ed�dZ�� Z\ed�d[�� Z]ed�d\�� Z^ed�d]�� Z_ed�d^�� Z`ed�d_�� Zaed�d`�� Zbed�da�� Zced�db�� Zded�dc�� Zeed�dd�� Zfed�de�� Zged�df�� Zhed�dg�� Zied�dh�� Zjed�di�� Zked�dj�� Zled�dk�� Zmed�dl�� Zned�dm�� Zoed�dn�� Zped�do�� Zqed�dp�� Zred�dq�� Zsed�dr�� Zted�ds�� Zued�dt�� Zved�du�� Zwed�dv�� Zxed�dw�� Zyed�dx�� Zzed�dy�� Z{ed�dz�� Z|ed�d{�� Z}ed�d|�� Z~ed�d}�� Zed�d~�� Z�ed�d�� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d��� Z�ed�d� Z�ed�dÄ� Z�edĄ � Z�edń � Z�edƄ � Z�edDŽ � Z�edȄ � Z�edɄ � Z�edʄ � Z�ed˄ � Z�y)��AXUtilitiesCollectionz?Utilities for finding all objects that meet a certain criteria.c �L � | sg S t j � }d|g}t j t j |d� t t || � � } dt | � � dt j � |z d�d�}t j t j |d� | S )Nz*AXUtilitiesCollection: Applying predicate TzAXUtilitiesCollection: z matches found in z.4f�s)�timer �printTokens� LEVEL_INFO�list�filter�len�printMessage)�matches�pred�start�tokens�msgs �>/usr/lib/python3/dist-packages/orca/ax_utilities_collection.py�_apply_predicatez&AXUtilitiesCollection._apply_predicate6 s� � ���I�� � ���>��E�� ���%�*�*�F�D�9��v�d�G�,�-��'��G��~�5G�� � ��V[�H[�\_�G`�`a�b�� ���5�+�+�S�$�7��� Nc �2 � | r|sg S t |� }dt j � d| |d|g}t j t j |d� t j ||�� }t j | |� }|�t j ||� }|S )N�AXUtilitiesCollection:�Root:�of:T)�states�state_match_type�r �inspect�currentframer r r r �create_match_rule�get_all_matchesr r )�root� state_listr# r r �ruler s r �_find_all_with_statesz+AXUtilitiesCollection._find_all_with_statesD s� � ����I��*�%� �*�G�,@�,@�,B��4�!1�5�*�F�� ���%�*�*�F�D�9��-�-�Z�Rb�c���.�.�t�T�:����+�<�<�W�d�K�G��r c �2 � | r|sg S t |� }dt j � d| |d|g}t j t j |d� t j ||�� }t j | |� }|�t j ||� }|S )Nr r r! T)�roles�role_match_typer$ )r) � role_listr/ r r r+ r s r �_find_all_with_rolez)AXUtilitiesCollection._find_all_with_roleU s� � ����I���O� �*�G�,@�,@�,B��4��%��D�� ���%�*�*�F�D�9��-�-�I��_���.�.�t�T�:����+�<�<�W�d�K�G��r c �. � | r|sg S t |� }dt j � d| d|g}t j t j |d� t j |�� }t j | |� }|�t j ||� }|S )zLReturns all descendants of root which implement all the specified interfacesr r zall of:T)� interfacesr$ )r) �interface_listr r r+ r s r �find_all_with_interfacesz.AXUtilitiesCollection.find_all_with_interfacesf s� � � ���I��n�-��*�G�,@�,@�,B��4��N�<�� ���%�*�*�F�D�9��-�-��H���.�.�t�T�:����+�<�<�W�d�K�G��r c �b � t j | |t j j |� S )z?Returns all descendants of root with any of the specified roles)r r1 r �CollectionMatchType�ANY�r) r0 r s r �find_all_with_rolez(AXUtilitiesCollection.find_all_with_roley s. � � %�8�8��)�U�6�6�:�:�D�B� Br c �b � t j | |t j j |� S )zFReturns all descendants of root which have none of the specified roles)r r1 r r7 �NONEr9 s r �find_all_without_rolesz,AXUtilitiesCollection.find_all_without_roles� s. � � %�8�8��)�U�6�6�;�;�T�C� Cr c � � | r|r|sg S t |� }t |� }dt j � d| d|d|g}t j t j |d� t j ||t j j �� }t j | |� }|�t j ||� }|S )zIReturns all descendants of root with any of the roles, and all the statesr r �Roles:�States:T�r. r"