403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.216.73
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/louis/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/louis/__pycache__/__init__.cpython-311.pyc
�

���c�Q��6�dZddlmZmZmZddlmZddlmZm	Z	m
Z
mZmZm
Z
mZmZmZ	ddlmZmZeecZZn#e$re
e	cZZYnwxYwedZedkZe���Zded	zzZerd
n	e��ZdedzzZd
�Zd5d�ZdZeefd�Z eej!��eej"_#e
ej_#eee��ee
��ee��ee
��ee��ee��e
fej$_%eee��ee
��ee��ee
��ee��ee��ee
��ee
��ee
��e
fej&_%eee��ee
��ee��ee
��ee��ee��e
fej'_%eee��ee
��ee��ee
��ee��ee��ee
��ee
��ee
��e
fej(_%eee��e
ee��e
fej)_%efej*_%eefej+_%eefej,_%eee��ee��e
e
fej-_%eee��ee��e
e
fej._%ede
e��Z/dej0_#dej1_#e
fej1_%d�Z2d�Z3d6d�Z4d7d�Z5d6d�Z6d7d�Z7d8d�Z8d�Z9d�Z:d�Z;d�Z<d8d�Z=d�Z>d�Z?dZ@d xZAxZBZCd	xZDxZEZFdxZGxZHZIdZJd!ZKd"ZLd#ZMd$ZNd%ZOd&ZPd'ZQd(ZRd)ZSd ZTd	ZUdZVd"ZWd#ZXd$ZYeYZZd%Z[dZ\d*Z]d+Z^d,Z_d-Z`d.Zad/Zbe\e]e^e_e`eaebfZcedd0kr-eee2����eee4d1gd2d3�4����dSdS)9a�Liblouis Python ctypes bindings
These bindings allow you to use the liblouis braille translator and back-translator library
from within Python.
This documentation is only related to the Python helper.
Please see the liblouis documentation for more information.

Most of these functions take a C{tableList}      argument which specifies
a list of translation tables to use. Please see the liblouis documentation
concerning the C{tableList} parameter to the C{lou_translateString}
function for information about how liblouis searches for these tables.

@author: Michael Curran <mick@kulgan.net>
@author: James Teh <jamie@jantrid.net>
@author: Eitan Isaacson <eitan@ascender.com>
@author: Michael Whapples <mwhapples@aim.com>
@author: Davy Kager <mail@davykager.nl>
@author: Leonard de Ruijter <alderuijter@gmail.com>
@author: Babbage B.V. <info@babbage.com>
@author: Andre-Abush Clause <dev@andreabc.net>
�)�getfilesystemencoding�platform�version_info)�register)	�c_ushort�	CFUNCTYPE�cdll�c_char_p�c_char�c_int�POINTER�byref�create_string_buffer)�WINFUNCTYPE�windllzliblouis.so.20�win32���mbcsz	utf_%d_le�c�@�d�d�|D����S)z*Creates a tables string for liblouis calls�,c��g|]@}t|t��r|�t��nt	|����AS�)�
isinstance�str�encode�fileSystemEncoding�bytes)�.0�xs  �0/usr/lib/python3/dist-packages/louis/__init__.py�
<listcomp>z'_createTablesString.<locals>.<listcomp>XsO��	
�	
�	
��-7�q�#�,>�,>�L�A�H�H�'�(�(�(�E�!�H�H�	
�	
�	
�)�join)�
tablesLists r"�_createTablesStringr'Us4���9�9�	
�	
��	
�	
�	
���r$Nc�@�|rt|z|�nt|z��S)z,Creates a typeform buffer for liblouis calls)r)�length�typeforms  r"�_createTypeformbufr+_s'��-5�P�H�v���)�)�H�v�<M�;P�;P�Pr$�
surrogatepassc�H�t|���||��S�N)rr)r!�encoding�errorss   r"�createEncodedByteStringr1gs���q�6�6�=�=��6�*�*�*r$c�Z�t����d��S)z�Obtain version information for liblouis.
    @return: The version of liblouis, plus other information, such as
        the release date and perhaps notable changes.
    @rtype: str
    �ASCII)�liblouis�lou_version�decoderr$r"�versionr7�s$�����!�!�(�(��1�1�1r$c�4�t���S)z�Obtain charSize information for liblouis.
    @return: The size of the widechar with which liblouis was compiled.
    @rtype: int
    )r4�lou_charSizerr$r"�charSizer:�s��
� � �"�"�"r$c�~�t|��}t|��}tt|��tz��}t|jtz��}t|jtz��}d}	|rt|j|��}	t|jz��}
t|jz��}t|��}t�
||t|��|t|��|	d||
t|��|��std|�d|�d|�d|�d|��
���t|t��rt|	��|dd�<|jd|jtz��t"t$���|
d|j�|d|j�|jfS)a�Translate a string of characters, providing position information.
    @param tableList: A list of translation tables.
    @type tableList: list of str
    @param inbuf: The string to translate.
    @type inbuf: str
    @param typeform: A list of typeform constants indicating the typeform for each position in inbuf,
        C{None} for no typeform information.
    @type typeform: list of int
    @param cursorPos: The position of the cursor in inbuf.
    @type cursorPos: int
    @param mode: The translation mode; add multiple values for a combined mode.
    @type mode: int
    @return: A tuple of: the translated string,
        a list of input positions for each position in the output,
        a list of output positions for each position in the input, and
        the position of the cursor in the output.
    @rtype: (str, list of int, list of int, int)
    @raise RuntimeError: If a complete translation could not be done.
    @see: lou_translate in the liblouis documentation
    N�Can't translate: tables �, inbuf �, typeform z, cursorPos �, mode �r0)r'r1r�len�
wideCharBytes�value�outlenMultiplierrr+r4�
lou_translater�RuntimeErrorr�list�rawr6�conversionEncoding�ENCODING_ERROR_HANDLER��	tableList�inbufr*�	cursorPos�mode�tablesString�inlen�outlen�outbuf�typeformbuf�inPos�outPoss            r"�	translaterW�s���*'�y�1�1�L�#�E�*�*�E��#�e�*�*�
�-�.�.�E�
�5�;�!1�1�
2�
2�F�
!�&�,��">�
?�
?�F��K��A�(���x�@�@��
�V�\�
!�$�$�E��e�k�!�
$�
$�F��i� � �I��!�!��
�
�e����
�f�
�
����
�
�i������
��l��y�y�%�%�%����9�9�9�d�d�
<�
�
�	
��(�D�!�!�(��;�'�'�������
�1�V�\�M�1�1�2�9�9��'=�	:�	
�	
�	�n���n���}���}����
�r$c
��t|��}t|��}tt|��tz��}t|jtz��}t|jtz��}d}|rt|j|��}t�
||t|��|t|��|d|��std|�d|�d|�d|�����t|t��rt|��|dd�<|jd|jtz��t"t$���S)a�Translate a string of characters.
    @param tableList: A list of translation tables.
    @type tableList: list of str
    @param inbuf: The string to translate.
    @type inbuf: str
    @param typeform: A list of typeform constants indicating the typeform for each position in inbuf,
        C{None} for no typeform information.
    @type typeform: list of int
    @param mode: The translation mode; add multiple values for a combined mode.
    @type mode: int
    @return: The translated string.
    @rtype: str
    @raise RuntimeError: If a complete translation could not be done.
    @see: lou_translateString in the liblouis documentation
    Nr<r=r>r?r@)r'r1rrArBrCrDrr+r4�lou_translateStringrrFrrGrHr6rIrJ�	rLrMr*rOrPrQrRrSrTs	         r"�translateStringr[sL�� '�y�1�1�L�#�E�*�*�E��#�e�*�*�
�-�.�.�E�
�5�;�!1�1�
2�
2�F�
!�&�,��">�
?�
?�F��K��A�(���x�@�@���'�'��
�
�e����
�f�
�
����	�	�

��l��y�y�%�%�%����4�4�
1�
�
�	
��(�D�!�!�(��;�'�'�������:�4���}�4�4�5�<�<��#9�=���r$c��t|��}t|��}tt|��tz��}t|jtz��}t|jtz��}d}	t|t��rt|j��}	t|jz��}
t|jz��}t|��}t�||t|��|t|��|	d||
t|��|��std|||||fz���t|t��rt|	��|dd�<|jd|jtz��t"t$���|
d|j�|d|j�|jfS)agBack translates a string of characters, providing position information.
    @param tableList: A list of translation tables.
    @type tableList: list of str
    @param inbuf: Braille to back translate.
    @type inbuf: str
    @param typeform: List where typeform constants will be placed.
    @type typeform: list
    @param cursorPos: Position of cursor.
    @type cursorPos: int
    @param mode: Translation mode.
    @type mode: int
    @return: A tuple: A string of the back translation,
        a list of input positions for each position in the output,
        a list of the output positions for each position in the input and
        the position of the cursor in the output.
    @rtype: (str, list of int, list of int, int)
    @raise RuntimeError: If a complete back translation could not be done.
    @see: lou_backTranslate in the liblouis documentation.
    NzMCan't back translate: tables %s, inbuf %s, typeform %s, cursorPos %d, mode %dr@)r'r1rrArBrCrDrrrGr+r4�lou_backTranslaterrFrHr6rIrJrKs            r"�
backTranslater^Fs���('�y�1�1�L�#�E�*�*�E��#�e�*�*�
�-�.�.�E�
�5�;�!1�1�
2�
2�F�
!�&�,��">�
?�
?�F��K��(�D�!�!�7�(���6�6��
�V�\�
!�$�$�E��e�k�!�
$�
$�F��i� � �I��%�%��
�
�e����
�f�
�
����
�
�i������
��[��%��9�d�;�
<�
�
�	
��(�D�!�!�(��;�'�'�������
�1�V�\�M�1�1�2�9�9��'=�	:�	
�	
�	�n���n���}���}����
�r$c
��t|��}t|��}tt|��tz��}t|jtz��}t|jtz��}d}t|t��rt|j��}t�||t|��|t|��|d|��std|||fz���t|t��rt|��|dd�<|jd|jtz��t"t$���S)aMBack translate from Braille.
    @param tableList: A list of translation tables.
    @type tableList: list of str
    @param inbuf: The Braille to back translate.
    @type inbuf: str
    @param typeform: List for typeform constants to be put in.
        If you don't want typeform data then give None
    @type typeform: list
    @param mode: The translation mode
    @type mode: int
    @return: The back translation of inbuf.
    @rtype: str
    @raise RuntimeError: If a complete back translation could not be done.
    @see: lou_backTranslateString in the liblouis documentation.
    Nz2Can't back translate: tables %s, inbuf %s, mode %dr@)r'r1rrArBrCrDrrrGr+r4�lou_backTranslateStringrrFrHr6rIrJrZs	         r"�backTranslateStringra�sG�� '�y�1�1�L�#�E�*�*�E��#�e�*�*�
�-�.�.�E�
�5�;�!1�1�
2�
2�F�
!�&�,��">�
?�
?�F��K��(�D�!�!�7�(���6�6���+�+��
�
�e����
�f�
�
����	�	�

��@��%��&�
'�
�
�	
��(�D�!�!�(��;�'�'�������:�4���}�4�4�5�<�<��#9�=���r$c�N�t|��}t|��}tt|��tz��}t|jdz��}t�|||||��std|||fz���|j�
d��S)a�Get information for hyphenation.
    @param tableList: A list of translation tables and hyphenation
        dictionaries.
    @type tableList: list of str
    @param inbuf: The text to get hyphenation information about.
        This should be a single word and leading/trailing whitespace
        and punctuation is ignored.
    @type inbuf: str
    @param mode: Lets liblouis know if inbuf is plain text or Braille.
        Set to 0 for text and anyother value for Braille.
    @type mode: int
    @return: A string with '1' at the beginning of every syllable
        and '0' elsewhere.
    @rtype: str
    @raise RuntimeError: If hyphenation data could not be produced.
    @see: lou_hyphenate in the liblouis documentation.
    �z-Can't hyphenate: tables %s, inbuf %s, mode %dr3)r'r1rrArBrrCr4�
lou_hyphenaterFr6)rLrMrOrPrQ�
hyphen_strings      r"�	hyphenaterf�s���$'�y�1�1�L�#�E�*�*�E��#�e�*�*�
�-�.�.�E�(���q��9�9�M��!�!�,��u�m�T�R�R�
��;�y�%�QU�>V�V�
�
�	
���%�%�g�.�.�.r$c�|�t|��}t�|��std|z���dS)a�Check if the specified tables can be found and compiled.
        This can be used to check if a list of tables contains errors
        before sending it to other liblouis functions
        that accept a list of tables.
    @param tableList: A list of translation tables.
    @type tableList: list of str
    @raise RuntimeError: If compilation failed.
    @see: lou_checkTable in the liblouis documentation
    zCan't compile: tables %sN)r'r4�lou_checkTablerF)rLrPs  r"�
checkTableri�sH��'�y�1�1�L��"�"�<�0�0�C��5�	�A�B�B�B�C�Cr$c��t|��}t|t��r|�d��nt	|��}t
�||��std|�d|�����dS)aHCompile a table entry on the fly at run-time.
    @param tableList: A list of translation tables.
    @type tableList: list of str
    @param inString: The table entry to be added.
    @type inString: str
    @raise RuntimeError: If compilation of the entry failed.
    @see: lou_compileString in the liblouis documentation
    r3zCan't compile entry: tables z, inString N)r'rrrrr4�lou_compileStringrF)rL�inStringrP�inBytess    r"�
compileStringrn�s���'�y�1�1�L�*4�X�s�*C�*C�X�h�o�o�g�&�&�&��x���G��%�%�l�G�<�<�
��l�=F�Y�Y���Q�
�
�	
�
�
r$c��t|��}tr|�d��}t�||��S)aGet the typeform bit for the named emphasis class.
    @param tableList: A list of translation tables.
    @type tableList: list of str
    @param emphClass: An emphasis class name.
    @type emphClass: str
    @see: lou_getTypeformForEmphClass in the liblouis documentation
    r3)r'�_is_py3rr4�lou_getTypeformForEmphClass)rL�	emphClassrPs   r"�getTypeformForEmphClassrs�sB��'�y�1�1�L��.��$�$�W�-�-�	��/�/��i�H�H�Hr$c��t|��}t|��}tt|��tz��}t|jtz��}t�||||d��std|�d|�����|j
d|jtz��tt���S)a�"Convert a string of dot patterns to a string of characters according to the specifications in tableList.
    @param tableList: A list of translation tables.
    @type tableList: list of str
    @param inbuf: a string of dot patterns, either in liblouis format or Unicode braille.
    @type inbuf: str
    @raise RuntimeError: If a complete conversion could not be done.
    @see: lou_dotsToChar in the liblouis documentation
    rz#Can't convert dots to char: tables r=Nr@)r'r1rrArBrrCr4�lou_dotsToCharrFrHr6rIrJ)rLrMrPr)rSs     r"�
dotsToCharrv�s���'�y�1�1�L�#�E�*�*�E�
�3�u�:�:��.�
/�
/�F�
!�&�,��">�
?�
?�F��"�"�<�����J�J�
��l�AJ���E�E�R�
�
�	
��:�4���}�4�4�5�<�<��#9�=���r$c��t|��}t|��}tt|��tz��}t|jtz��}t�|||||��std|||fz���|j
d|jtz��tt���S)a�"Convert a string of characterss to a string of dot patterns according to the specifications in tableList.
    @param tableList: A list of translation tables.
    @type tableList: list of str
    @param inbuf: a string of characters.
    @type inbuf: str
    @param mode: The translation mode; add multiple values for a combined mode.
    @type mode: int
    @raise RuntimeError: If a complete conversion could not be done.
    @see: lou_charToDots in the liblouis documentation
    z8Can't convert char to dots: tables %s, inbuf %s, mode %dNr@)r'r1rrArBrrCr4�lou_charToDotsrFrHr6rIrJ)rLrMrOrPr)rSs      r"�
charToDotsrys���'�y�1�1�L�#�E�*�*�E�
�3�u�:�:��.�
/�
/�F�
!�&�,��">�
?�
?�F��"�"�<�����M�M�
��F��%��&�
'�
�
�	
��:�4���}�4�4�5�<�<��#9�=���r$c��|�At|t��s,td�tj�����t
�|��S)a|Register logging callbacks.
    Set to C{None} for default callback.
    @param logCallback: The callback to use.
        The callback must take two arguments:
        @param level: The log level on which a message is logged.
        @type level: int
        @param message: The logged message.
            Note that the callback should provide its own ASCII decoding routine.
        @type message: bytes

        Example callback:

        @louis.LogCallback
        def incomingLouisLog(level, message):
            print("Message %s logged at level %d" % (message.decode("ASCII"), level))

    @type logCallback: L{LogCallback}
    Nz,logCallback should be of type {} or NoneType)r�LogCallback�	TypeError�format�__name__r4�lou_registerLogCallback)�logCallbacks r"�registerLogCallbackr�)sU��&��z�+�{�'K�'K���:�A�A�+�BV�W�W�
�
�	
��+�+�K�8�8�8r$c�l�|tvrtd|z���t�|��S)z�Set the level for logging callback to be called at.
    @param level: one of the C{LOG_*} constants.
    @type level: int
    @raise ValueError: If an invalid log level is provided.
    z Level %d is an invalid log level)�	logLevels�
ValueErrorr4�lou_setLogLevel)�levels r"�setLogLevelr�Cs7��
�I����;�e�C�D�D�D��#�#�E�*�*�*r$rc�� �@��iiiii'i Ni0ui@�iP�i`��__main__s../tables/en-us-g2.ctbzHello world!�)rNr.)Nrr)Nr)r)f�__doc__�sysrrr�atexitr�ctypesrrr	r
rrr
rrrr�_loader�	_functype�ImportErrorr4�_is_windowsr9rBrDrrIr'r+rJr1�lou_freer5�restyperY�argtypesrEr`r]rdrhrkrqrurxr{rr�r7r:rWr[r^rarfrirnrsrvryr�r��
plain_text�emph_1�comp_emph_1�italic�emph_2�comp_emph_2�	underline�emph_3�comp_emph_3�bold�emph_4�emph_5�emph_6�emph_7�emph_8�emph_9�emph_10�computer_braille�no_translate�no_contract�noContractions�compbrlAtCursor�dotsIO�compbrlLeftCursor�ucBrl�noUndefined�noUndefinedDots�partialTrans�LOG_ALL�	LOG_DEBUG�LOG_INFO�LOG_WARN�	LOG_ERROR�	LOG_FATAL�LOG_OFFr�r~�printrr$r"�<module>r�s���*��*>�=�=�=�=�=�=�=�=�=�������
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�)�*�*�*�*�*�*�*�*����G�Y�Y���)�)�)��y��G�Y�Y�Y�)�����#�$���'�!���%�%�'�'�
��}�q�(�(�� +�G�V�V�0E�0E�0G�0G��!�M�A�$5�6�����Q�Q�Q�Q�
)��#�+A�+�+�+�+�	���	����'���� %����
��G�F�O�O��G�E�N�N��G�F�O�O��G�E�N�N��G�H����G�F�O�O�	�	)���%�
��G�F�O�O��G�E�N�N��G�F�O�O��G�E�N�N��G�H����G�F�O�O��G�E�N�N��G�E�N�N��G�E�N�N�	�#����
��G�F�O�O��G�E�N�N��G�F�O�O��G�E�N�N��G�H����G�F�O�O�	�	-�� �)�
��G�F�O�O��G�E�N�N��G�F�O�O��G�E�N�N��G�H����G�F�O�O��G�E�N�N��G�E�N�N��G�E�N�N�	�'���#�
��G�F�O�O�	��G�F�O�O�	�#����%-�;��� �'/��&:���#�19�8�0D��$�-�
��G�F�O�O��G�F�O�O�	�	�$��� �
��G�F�O�O��G�F�O�O�	�	�$��� ��i��e�X�.�.��+/�� �(�#'��� �%*�H���!�2�2�2�#�#�#�:�:�:�:�z*�*�*�*�Z9�9�9�9�x*�*�*�*�Z/�/�/�/�:C�C�C�
�
�
�"I�I�I����,����29�9�9�4+�+�+��
� &�&��&��v�#)�)��)��y�$�$��$��t�	��	��	��	��	��	��
������������	
����
�����������	������	��	�
���i��8�Y�	�7�S�	��z���	�E�'�'�)�)����	�E�)�)�.�/��1�
M�
M�
M�N�N�N�N�N��s�
8�
A�A

Youez - 2016 - github.com/yon3zu
LinuXploit