Mini Shell

Direktori : /proc/self/root/lib/python3.6/site-packages/orca/__pycache__/
Upload File :
Current File : //proc/self/root/lib/python3.6/site-packages/orca/__pycache__/notification_messages.cpython-36.pyc

3

�2[��@sdZdZdZdZdZdZddlZdd	lmZdd
lm	Z	ddlm
Z
ddlmZdd
lmZgZ
dZdadaiZd+dd�Zd,dd�Zd-dd�Ze
jeej�ed<e
jeej�ed<e
jeej�ed<dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Z d.d)d*�Z!dS)/z Module for notification messagesz$Id$z
$Revision$z$Date$z-Copyright (c) 2010 Informal Informatica LTDA.ZLGPL�N�)�cmdnames)�debug)�input_event)�messages)�
orca_state�7cCst|d�dS)z( Repeats the last notification message. rT)�_showNotificationMessage)�script�
inputEvent�r�+/usr/lib/python3.6/notification_messages.py�repeatLastNotificationMessage4s
rcCst|d�dS)z, Repeats the previous notification message. �T)r	)r
rrrr
�!repeatPreviousNotificationMessage:s
rcCst|�dS)z+ Enables the list of notification message. T)�_listModeEnable)r
rrrr
�!enableNotificationMessageListMode@srZ$repeatLastNotificationMessageHandlerZ(repeatPreviousNotificationMessageHandlerZ(enableNotificationMessageListModeHandlercCs|j|�dS)N)ZpresentMessage)r
�msgrrr
�_showMessageUsrcCs8xt�tkrtd=qWtj|�tjtjdt��dS)z0save the message in a list to be presented laterrzsaveMessage (queue length: %s)N)�size�maxSizeList�notificationMessages�appendr�println�LEVEL_FINEST)rrrr
�saveMessageXs

rcCstt�S)z' return the size of the queue messages )�lenrrrrr
rdsrcCst�dkrt|tj�dSdS)NrFT)rrrZNOTIFICATION_NO_MESSAGES)r
rrr
�_messagesPresentis
rcCs.t|�r*dadadt_t|d�t|t�dS)z0 enable the list mode if the queue is not empty rrT)r�indexNotificationMessages�invalidKeysr�listNotificationsModeEnabled�_helpr	)r
rrr
rqs

rcCs�t|�sdS|dkr&d}t|tj�n|t�krBt�}t|tj�|at�|}tjtj	dt�|f�|dkr�|t�kr�t
|}t||�dS)Nrz6_showNotificationMessage (queue length: %s, index: %s)r)rrrZNOTIFICATION_LIST_TOPrZNOTIFICATION_LIST_BOTTOMrrrrr)r
�indexrrrr
r	s 

r	cCsdt_t|tj�dS)z, Turns list notification messages mode off. FN)rr rrZNOTIFICATION_LIST_EXIT)r
rrr
� exitListNotificationMessagesMode�sr#c
Cs�d}d}|jtjkrdS|j�|jdkr8t|�d}n�|jdkrHdan�|jdkrZt�an�|jdkrntd8anp|jdkr�td7an\|jdkr�t|j�anF|jdkr�t	|d�d}n,|jdkr�n d}t
d7a
t
dkr�t	|�da
|�r�t|t�da
|S)a When list notification messages  mode is enabled, this function
    provides a means by which users can navigate through the list the
    notification messages. User can use the navigation keys or press
    the number of the message. Pressing escape key disable the mode.
    TFZEscapeZHomerZEndZUpZDown�1�2�3�4�5�6�7�8�9�h�HZspacerr)	r$r%r&r'r(r)r*r+r,)r-r.)�type�pyatspiZKEY_PRESSED_EVENTZpresentationInterruptZevent_stringr#rr�intr!rr	)r
Zevent�consumedZspeakrrr
�listNotificationMessages�sB	










r3FcCs2tjt��}|tj7}|r$|tj7}t||�dS)N)rZ
messagesCountrZNOTIFICATION_LIST_HELPZNOTIFICATION_LIST_TUTORIALr)r
ZlongHelprrrr
r!�s


r!)N)N)N)F)"�__doc__Z__id__�__version__Z__date__Z
__copyright__Z__license__r0�rrrrrrrrrZinputEventHandlersrrrZInputEventHandlerZNOTIFICATION_MESSAGES_LASTZNOTIFICATION_MESSAGES_PREVIOUSZNOTIFICATION_MESSAGES_LISTrrrrrr	r#r3r!rrrr
�<module>sJ


/