403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.156
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/orca/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/orca/__pycache__/spellcheck.cpython-310.pyc
o

S�bH(�@s~dZdZdZdZdZdZddlZddlZddlm	Z	dd	lm
Z
dd
lmZddlmZddlm
Z
e
��ZGd
d�d�ZdS)z:Script-customizable support for application spellcheckers.z$Id$z
$Revision$z$Date$zCopyright (c) 2014 Igalia, S.L.�LGPL�N)�	guilabels)�messages)�object_properties)�
orca_state)�settings_managerc@s�eZdZd>dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd?d%d&�Zd?d'd(�Zd?d)d*�Zd@d+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Zd=S)A�
SpellCheckTcCsF||_||_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
dS)NF)N���)�_script�_hasChangeToEntry�_window�_errorWidget�_changeToEntry�_suggestionsList�
_activated�_documentPosition�spellErrorCheckButton�spellSuggestionCheckButton�presentContextCheckButton)�self�script�hasChangeToEntry�r�1/usr/lib/python3/dist-packages/orca/spellcheck.py�__init__+s
zSpellCheck.__init__cCsf|�|�sdS|jr|�|�|_|jsdS|�|�|_|js dS|�|�|_|js+dS||_d|_	dS)NFT)
�_isCandidateWindowr�_findChangeToEntryr�_findErrorWidgetr
�_findSuggestionsListrrr�r�windowrrr�activate9s
zSpellCheck.activatecCs|��dS�N)�_clearState�rrrr�
deactivateNszSpellCheck.deactivatecC�|jSr"�rr$rrr�getDocumentPositionQ�zSpellCheck.getDocumentPositioncCs||f|_dSr"r')r�obj�offsetrrr�setDocumentPositionTszSpellCheck.setDocumentPositioncCr&r")r
r$rrr�getErrorWidgetWr)zSpellCheck.getErrorWidgetcC�|jsdS|jj�|j�S�N��r
r
�	utilities�
displayedTextr$rrr�getMisspelledWordZ�zSpellCheck.getMisspelledWordcCr.r/r1r$rrr�getCompletionMessage`r5zSpellCheck.getCompletionMessagecCr&r")rr$rrr�getChangeToEntryfr)zSpellCheck.getChangeToEntrycCr&r")rr$rrr�getSuggestionsListir)zSpellCheck.getSuggestionsListcCr&r")rr$rrr�isActivelr)zSpellCheck.isActivecCs|r	||jkr	dS|�|�S)NT)rr!rrrr�
isCheckWindowos
zSpellCheck.isCheckWindowcCs*z|j��}WnYdS|�tj�S�NF)r�getState�contains�pyatspi�STATE_SENSITIVE)r�staterrr�
isCompleteus
zSpellCheck.isCompletecC�dSr;r)r�eventrrr�isAutoFocusEvent|�zSpellCheck.isAutoFocusEventcCs|jsdS|o|j|jkSr;)r�parent)rr*rrr�isSuggestionsItemr5zSpellCheck.isSuggestionsItemcs�|��sdS|j\}}|r|dksdSz|��}WnYdStj}|�||�\}}}|sZtj}|�||�\}}}t�d|�}|�	��|�
��dkrZtt�fdd�|��}	|	d}|s^dSt
j|}
|jjj|
d�}|jj|
|d�d	S)
NFrz(?:\.|\!|\?)�cs
|���Sr")�count)�x��wordrr�<lambda>�s
z+SpellCheck.presentContext.<locals>.<lambda>��string��voiceT)r9r�	queryTextr>�TEXT_BOUNDARY_SENTENCE_START�getTextAtOffset�TEXT_BOUNDARY_LINE_START�re�splitr4rI�list�filterr�MISSPELLED_WORD_CONTEXTr
�speechGeneratorrQ�speakMessage)rr*r+�text�boundaryrO�start�end�	sentences�match�msgrQrrKr�presentContext�s2

zSpellCheck.presentContextcCsJ|��r|��s
dS|j��|��}|jjj|d�}|jj||d�dS)NFrNrPT)r9rAr
�clearBrailler6r[rQ�presentMessage)rrcrQrrr�presentCompletionMessage�s
z#SpellCheck.presentCompletionMessageFcCs>|��rdS|�|�r|�|�|st�d�r|��dSdS)NF�spellcheckPresentContextT)rA�presentMistake�presentSuggestion�_settingsManager�
getSettingrd)r�detailedrrr�presentErrorDetails�s

zSpellCheck.presentErrorDetailscCsd|��sdS|��}|sdStj|}|jjj|d�}|jj||d�|s*t�	d�r0|j�
|�dS)NFrNrP�spellcheckSpellErrorT)r9r4r�MISSPELLED_WORDr
r[rQr\rkrl�spellCurrentItem)rrmrLrcrQrrrri�s
zSpellCheck.presentMistakecCs�|js
|j|dd�S|��sdS|j}|sdS|jj�|�p |j}|jj�|dd�}d||f}|jj	j
|d�}|jj||d�|sGt�
d	�rM|j�|�dS)
NT)�includeLabelFrr	�%s %srNrP�spellcheckSpellSuggestion)r�presentSuggestionListItemr9rr
r2�displayedLabel�name�	substringr[rQr\rkrlrq)rrm�entry�labelrOrcrQrrrrj�szSpellCheck.presentSuggestioncCs�|��sdS|j}|s
dS|jj�|�}t|�dksdS|r)|jj�|�p'|j}nd}|dj}d||f}|jjj	|d�}|jj
|��|d�|sOt�
d�rU|j�|�t�
d	�rx|dtjkrx|�|d�\}	}
tj|	|
d
�}|j�
|�dS)NFrHr0rrsrNrPrt�enablePositionSpeaking)�index�totalT)r9rr
r2�selectedChildren�lenrvrwr[rQr\�striprkrlrqr�locusOfFocus�_getSuggestionIndexAndPositionr�GROUP_INDEX_SPEECH)rrmrr�suggestions�itemsrzrOrcrQr|r}rrrru�s.

z$SpellCheck.presentSuggestionListItemcCs"d|_d|_d|_d|_d|_dSr;)rr
rrrr$rrrr#s

zSpellCheck._clearStatecCrBr;rrrrrr	rEzSpellCheck._isCandidateWindowcC�dSr"r�r�rootrrrrrEzSpellCheck._findChangeToEntrycCr�r"rr�rrrrrEzSpellCheck._findErrorWidgetcCr�r"rr�rrrrrEzSpellCheck._findSuggestionsListcCrB)N)r	r	r)r�
suggestionrrrr�rEz)SpellCheck._getSuggestionIndexAndPositioncCs6ddlm}|��}|jdtjd�}|�d�|�|�|j�	dddd�}|�
dddd�|�|�|��}|�|�tj
}t�d	�}|j�|�|_|j�|�|�|jdddd�tj}t�d
�}|j�|�|_|j�|�|�|jdddd�tj}t�d�}|j�|�|_|j�|�|�|jdddd�|S)
Nr)�Gtkz	<b>%s</b>)rzTg�?rH�rortrh�)�
gi.repositoryr��Frame�Labelr�SPELL_CHECK�set_use_markup�set_label_widget�	Alignment�new�set_padding�add�Grid�SPELL_CHECK_SPELL_ERRORrkrl�CheckButton�new_with_mnemonicr�
set_active�attach�SPELL_CHECK_SPELL_SUGGESTIONr�SPELL_CHECK_PRESENT_CONTEXTr)rr��framerz�	alignment�grid�valuerrr�getAppPreferencesGUIs4






zSpellCheck.getAppPreferencesGUIcCs|j��|j��|j��d�S)z7Returns a dictionary with the app-specific preferences.)rortrh)r�
get_activerrr$rrr�getPreferencesFromGUI<s�z SpellCheck.getPreferencesFromGUIN)T)F)FF) �__name__�
__module__�__qualname__rr!r%r(r,r-r4r6r7r8r9r:rArDrGrdrgrnrirjrur#rrrrr�r�r�rrrrr)s<
"




 $r)�__doc__�__id__�__version__�__date__�
__copyright__�__license__r>rV�orcarrrrr�
getManagerrkrrrrr�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit