Mini Shell
3
���Xd � @ s6 d dl mZ d dlT d dlT dgZG dd� de�ZdS )� )�Atspi)�*�Documentc @ s8 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� ZdS )
r a�
Primarily a 'tagging' interface which indicates the start of
document content in the Accessibility hierarchy. Accessible objects
below the node implementing Document are normally assumed to
be part of the document content. Attributes of Document are those
attributes associated with the document as a whole. Objects that
implement Document are normally expected to implement Collection
as well.
c C s t jj| j|�S )a�
Gets the value of a single attribute, if specified for the document
as a whole.
@param : attributename
a string indicating the name of a specific attribute (name-value
pair) being queried.
@return a string corresponding to the value of the specified
attribute, or an empty string if the attribute is unspecified
for the object.
)r r Zget_document_attribute_value�obj)�self�key� r �/usr/lib/python3.6/document.py�getAttributeValue% s zDocument.getAttributeValuec C s t jj| j�}dd� |j� D �S )a[
Gets all attributes specified for a document as a whole. For
attributes which change within the document content, see Accessibility::Text::getAttributes
instead.
@return an AttributeSet containing the attributes of the document,
as name-value pairs.
c S s g | ]\}}|d | �qS )�:r )�.0r �valuer r r �
<listcomp>; s z*Document.getAttributes.<locals>.<listcomp>)r r Zget_document_attributesr �items)r �retr r r �
getAttributes2 s zDocument.getAttributesc C s t jj| j�S )z�
Gets the locale associated with the document's content. e.g.
the locale for LOCALE_TYPE_MESSAGES.
@return a string compliant with the POSIX standard for locale
description.
)r r Z
get_localer )r r r r � getLocale= s zDocument.getLocalec C s t jj| j�S )z�
Gets the current page number associated with the document.
@return a integer with the current page number. -1 if error
or unknown.
)r r Zget_current_page_numberr )r r r r �getCurrentPageNumberF s zDocument.getCurrentPageNumberc C s t jj| j�S )z�
Gets the page count of the document.
@return a integer with the page count of the document.
-1 if error or unknown.
)r r Zget_page_countr )r r r r �getPageCountN s zDocument.getPageCountN) �__name__�
__module__�__qualname__�__doc__r
r r r r r r r r r s
N)Z
gi.repositoryr Z
pyatspi.utilsZpyatspi.interface�__all__Z interfacer r r r r �<module> s