Mini Shell
3
���XK7 � @ s d dl Zd dlmZ d dljZd dljZddddddd d
ddd
dddddddddgZdd� Z dd� Z
dd� Zdd� Zdd� Z
dd� Zdd � Zdd
� Zdd� Zd d� Zd3d"d�Zd#d$� Zd%d&� Zd'd� Zd(d)� Zd*d� Zd+d� Zd,d� Zd-d� Zd.d� Zd/d� ZG d0d1� d1e�Zd2d� Z dS )4� N)�allModifiers�
setCacheLevel�
getCacheLevel�
clearCache�
printCache�getInterfaceIID�getInterfaceName�listInterfaces�
stringToConst�
stateToString�relationToStringr �findDescendant�findAllDescendants�findAncestor�getPath�pointToList�
rectToList�attributeListToHash�hashToAttributeList�getBoundingBoxc C s d S )N� )�levelr r �/usr/lib/python3.6/utils.pyr 4 s c C s d S )Nr r r r r r 7 s c C s d S )Nr r r r r r : s c C s t d� d S )Nz"Print cache function is deprecated)�printr r r r r = s c C s dS )a�
Gets the ID of an interface class or object in string format for use in
queryInterface.
@param obj: Class representing an AT-SPI interface or instance
@type obj: object
@return: IID for the interface
@rtype: string
@raise AttributeError: When the parameter does not provide typecode info
WARNING!! DEPRECATED!!
In current D-Bus version of pyatspi this simply returns a null string.
� r )�objr r r r @ s c C s | j jd�S )aX
Gets the human readable name of an interface class or object in string
format.
@param obj: Class representing an AT-SPI interface or instance
@type obj: class
@return: Name of the interface
@rtype: string
@raise AttributeError: When the parameter does not provide typecode info
zorg.a11y.atspi.)Z_dbus_interface�lstrip)r r r r r Q s c C s | j � S )a
Gets a list of the names of all interfaces supported by this object. The
names are the short-hand interface names like "Accessible" and "Component",
not the full interface identifiers.
@param obj: Arbitrary object to query for all accessibility related
interfaces. Must provide a queryInterface method.
@type obj: object
@return: Set of supported interface names
@rtype: set
@raise AttributeError: If the object provide does not implement
queryInterface
)Zget_interfaces)r r r r r ^ s c C s( | j � d |j � jdd� }tt||�S )a
Maps a string name to an AT-SPI constant. The rules for the mapping are as
follows:
- The prefix is captalized and has an _ appended to it.
- All spaces in the suffix are mapped to the _ character.
- All alpha characters in the suffix are mapped to their uppercase.
The resulting name is used with getattr to look up a constant with that name
in the L{constants} module. If such a constant does not exist, the string
suffix is returned instead.
This method allows strings to be used to refer to roles, relations, etc.
without direct access to the constants. It also supports the future expansion
of roles, relations, etc. by allowing arbitrary strings which may or may not
map to the current standard set of roles, relations, etc., but may still
match some non-standard role, relation, etc. being reported by an
application.
@param prefix: Prefix of the constant name such as role, relation, state,
text, modifier, key
@type prefix: string
@param suffix: Name of the role, relation, etc. to use to lookup the constant
@type suffix: string
@return: The matching constant value
@rtype: object
�_� )�upper�replace�getattrZ constants)�prefix�suffix�namer r r r
n s c C s t jj| �S )aD
Converts a state value to a string based on the name of the state constant in
the L{constants} module that has the given value.
@param value: An AT-SPI state
@type value: Accessibility.StateType
@return: Human readable, untranslated name of the state
@rtype: string
)�stateZSTATE_VALUE_TO_NAME�get)�valuer r r r � s
c C s t jjj| �S )aP
Converts a relation value to a string based on the name of the state constant
in the L{constants} module that has the given value.
@param value: An AT-SPI relation
@type value: Accessibility.RelationType
@return: Human readable, untranslated name of the relation
@rtype: string
)�pyatspiZ
AccessibilityZRELATION_VALUE_TO_NAMEr&