__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

�D�g������SrSSKrSSKrSSKrSSKrSSKrSSKrSSKJ	r	 "SS\
5r"SS\5r
"S	S
\
5r"SS\5r"S
S\5r"SS\5r"SS\5r"SS\
5r"SS\
5r"SS\
5r"SS\
5r"SS\
5r"SS\
5r"SS \
5r"S!S"\
5r"S#S$\5r"S%S&\5r"S'S(\
5rg! SSKrN�=f))z�Python API to Speech Dispatcher

Basic Python client API to Speech Dispatcher is provided by the 'SSIPClient'
class.  This interface maps directly to available SSIP commands and logic.

A more convenient interface is provided by the 'Speaker' class.

�N�)�pathsc�:�\rSrSrSrSrSrSrSrSr	Sr
S	rg
)�CallbackType�$z5Constants describing the available types of callbacks�index_marks�begin�end�cancel�pause�resume�N)�__name__�
__module__�__qualname__�__firstlineno__�__doc__�
INDEX_MARK�BEGIN�END�CANCEL�PAUSE�RESUME�__static_attributes__r��0/usr/lib/python3/dist-packages/speechd/client.pyrr$sE��?��J��
�E�&�
�C�;�
�F��
�E�4�
�F�)rrc��\rSrSrSrSrg)�	SSIPError�;z;Common base class for exceptions during SSIP communication.rN�rrrrrrrrrrr;s��Errc�R^�\rSrSrSrSrSU4SjjrSrSrSr	Sr
S	rS
rU=r
$)�SSIPCommunicationError�>z?Exception raised when trying to operate on a closed connection.Nc�F>�X lXl[[U]"S0UD6 g)Nr)�_original_exception�_description�superr�__init__)�self�description�original_exception�kwargs�	__class__s    �rr(�SSIPCommunicationError.__init__Cs!���#5� �'��
�i��'�1�&�1rc��UR$)z�Return the original exception if any

If this exception is secondary, being caused by a lower
level exception, return this original exception, otherwise
None)r%�r)s rr+�)SSIPCommunicationError.original_exceptionHs���'�'�'rc��Xlg)z@Set an additional exception

See method additional_exception().
N��_additional_exception)r)�	exceptions  r�set_additional_exception�/SSIPCommunicationError.set_additional_exceptionPs
��
&/�"rc��UR$)zoReturn an additional exception

Additional exceptions araise from failed attempts to resolve
the former problemr3r0s r�additional_exception�+SSIPCommunicationError.additional_exceptionWs��
�)�)�)rc��UR$)zReturn error description)r&r0s rr*�"SSIPCommunicationError.description^s��� � � rc��/nUR5(aURUR55 UR(a+URS[UR55-5 UR(a+URS[UR	55-5 SRU5$)NzOriginal error: zAdditional error: �
)r*�appendr+�strr9�join)r)�msgss  r�__str__�SSIPCommunicationError.__str__bs�����������K�K��(�(�*�+��"�"��K�K�*�S��1H�1H�1J�-K�K�L��$�$��K�K�,�s�4�3L�3L�3N�/O�O�P��y�y���r)r4r&r%�NN)rrrrrr4r(r+r6r9r*rCr�
__classcell__�r-s@rr"r">s/���I� ��2�
(�/�*�!��rr"c�&�\rSrSrSrSrSrSrg)�SSIPResponseError�lc�`�[RX<SU<35 XlX lX0lg)Nz: )�	Exceptionr(�_code�_msg�_data�r)�code�msg�datas    rr(�SSIPResponseError.__init__ms&�����4�T�3�!7�8��
��	��
rc��UR$)z8Return the server response error code as integer number.)rMr0s rrQ�SSIPResponseError.codes����z�z�rc��UR$)z/Return server response error message as string.)rNr0s rrR�SSIPResponseError.msgws���y�y�r)rMrOrNN)rrrrr(rQrRrrrrrIrIls����rrIc��\rSrSrSrSrSrg)�SSIPCommandError�|z9Exception raised on error response after sending command.c��UR$)z7Return the command string which resulted in this error.�rOr0s r�command�SSIPCommandError.commandrWrrN)rrrrrr_rrrrr[r[|s
��C�rr[c��\rSrSrSrSrSrg)�
SSIPDataError�z6Exception raised on error response after sending data.c��UR$)z-Return the data which resulted in this error.r^r0s rrS�SSIPDataError.data�rWrrN)rrrrrrSrrrrrbrb�s
��@�rrbc��\rSrSrSrSrg)�
SpawnError�z&Indicates failure in server autospawn.rNr rrrrgrg�s��0rrgc�"�\rSrSrSrSrSrSrg)�CommunicationMethod�zBConstants describing the possible methods of connection to server.�unix_socket�inet_socketrN�rrrrr�UNIX_SOCKET�INET_SOCKETrrrrrjrj�s��L��K�;��K�9rrjc��\rSrSrSrSrSrSr\\-\-r\\-\-r	\\-r
\\-r\R\R\R\R \R"\R$S.rSrSrS	rS
rSrSrS
rSrSrSrg)�_SSIP_Connection�z/Implementation of low level SSIP communication.s
�.s..)i�i�i�i�i�i�c��U[R:Xa[RnUnOXU[R:Xa9U(aU(de[R
n[R"U5U4nO[S5e[R"U[R5Ul	URRU5 SUl
/UlSUl[ R""S5Ul[ R&"UR(0SSS	9UlUR*R-5 g![Ran[SU-US9eSnAff=f)
zhInit connection: open the socket to server,
initialize buffers, launch a communication handling
thread.
z Unsupported communication methodzCan't open socket using method )r+Nrrz SSIP client communication threadT)�targetr,�name�daemon)rjro�socket�AF_UNIXrp�AF_INET�
gethostbyname�
ValueError�SOCK_STREAM�_socket�connect�errorr"�_buffer�_com_buffer�	_callback�	threading�	Semaphore�_ssip_reply_semaphore�Thread�_communication�_communication_thread�start)r)�communication_method�socket_path�host�port�
socket_family�socket_connect_args�exs        rr(�_SSIP_Connection.__init__�s2�� �#6�#B�#B�B�"�N�N�M�"-��
!�%8�%D�%D�
D��D� �=�"�N�N�M�#)�#7�#7��#=�t�"D���?�@�@�	B�!�=�=���8J�8J�K�D�L��L�L� � �!4�5����������%.�%8�%8��%;��"�� � ��(;�(;�B�&H�(,�.�	
�"�	
�"�"�(�(�*���|�|�	B�(�)J�+?�*@�>@�B�
B��	B�s�AD7�7E�
E�Ec���URR[R5 URR5 URR5 g![Ra NKf=f)z>Close the server connection, destroy the communication thread.N)r�shutdownry�	SHUT_RDWRr��closer�rAr0s rr��_SSIP_Connection.close�s[��	��L�L�!�!�&�"2�"2�3�	
�������"�"�'�'�)��	�|�|�	��	�s�)A � A7�6A7c��UR5upnUS-S:wa9URRXU45 URR5 MWURbVURUnU[R:XaSUS0nO0n[[USS5upgUR"XgU40UD6 M�![a gf=f)a�Handle incoming socket communication.

Listens for all incoming communication on the socket, dispatches
events and puts all other replies into self._com_buffer list in the
already parsed form as (code, msg, data).  Each time a new item is
appended to the _com_buffer list, the corresponding semaphore
'self._ssip_reply_semaphore' is incremented.

This method is designed to run in a separate thread.  The thread can be
interrupted by closing the socket on which it is listening for
reading.N�d��
index_mark�)�
_recv_message�IOErrorr�r?r��releaser��_CALLBACK_TYPE_MAPrr�map�int)r)rQrRrS�typer,�msg_id�	client_ids        rr��_SSIP_Connection._communication�s����
�"&�"4�"4�"6���4��S�y�A�~�� � �'�'��D�(9�:��*�*�2�2�4���~�~�)��.�.�t�4���<�2�2�2�*�D��G�4�F��F�$'��T�"�1�X�$6�!�����v�$�A�&�A�)���
��
�s�B=�=
C
�	C
c���URRUR5nUS:XasURR	S5n[
U5S:Xa[
eU=RU-
slURRUR5nUS:XaMsURSUnURU[
UR5-SUlURS5$! [
e=f)z]Read one whole line from the socket.

Blocks until the line delimiter ('_NEWLINE') is read.

���irN�utf-8)r��find�_NEWLINEr�recvr��len�decode)r)�pointer�d�lines    r�	_readline�_SSIP_Connection._readline�s����,�,�#�#�D�M�M�2����m�
��L�L�%�%�d�+���1�v��{��
��L�L�A��L��l�l�'�'��
�
�6�G���m��|�|�H�W�%���|�|�G�C��
�
�,>�$>�$?�@����{�{�7�#�#��
��
�s�C)�)C1c�0�/nSnUR5n[U5S:�dS5eUSSUSUSSpenUR5(aUbXB:XaUS;dS5eUS:XaUn[U5U[	U54$UnURU5 M�)zLRead server response or a callback
and return the triplet (code, msg, data).N�z$Malformed data received from server!�)�-� r�)r�r��isalnumr��tupler?)r)rS�cr�rQ�sep�textrRs        rr��_SSIP_Connection._recv_messages���������>�>�#�D��t�9��>�I�#I�I�>�"�2�A�h��Q���a�b��t�D��<�<�>�>�q�y�D�I��*�$�
M�&L�
M�%��c�z����4�y�#�u�T�{�2�2��A��K�K���rc��URR5(d[eURR	5 UR
SnUR
S	U$)z\Read server response from the communication thread
and return the triplet (code, msg, data).r)r��is_aliver"r��acquirer�)r)�responses  r�_recv_response�_SSIP_Connection._recv_response!sT��
�)�)�2�2�4�4�(�(��"�"�*�*�,��#�#�A�&�����Q���rc	��US;aAUS[R[R4;d[US[5(deSRU4[
[[U55-5nURRURS5UR-5 UR!5upEnUS-S:wa[#XEU5eXEU4$![Ra [S5ef=f)abSend SSIP command with given arguments and read server response.

Arguments can be of any data type -- they are all stringified before
being sent to the server.

Returns a triplet (code, msg, data), where 'code' is a numeric SSIP
response code as an integer, 'msg' is an SSIP rsponse message as string
and 'data' is a tuple of strings (all lines of response data) when a
response contains some data.

'SSIPCommandError' is raised in case of non 2xx return code.  See SSIP
documentation for more information about server responses and codes.

'IOError' is raised when the socket was closed by the remote side.

)�SETr�STOPrr�r��"Speech Dispatcher connection lost.r�r�)�Scope�SELF�ALL�
isinstancer�rAr�r�r@r�send�encoder�ryr�r"r�r[)r)r_�args�cmdrQrRrSs       r�send_command�_SSIP_Connection.send_command.s���"��4�4��A�w�5�:�:�u�y�y�"9�9�$�T�!�W�c�2�2�3�3��h�h��z�E�#�c�4�.�$9�9�:��	O��L�L���c�j�j��1�D�M�M�A�B��-�-�/���4���9��>�"�4�c�2�2��$�����|�|�	O�(�)M�N�N�	O�s�67C� C9c���URS5nURUR5(a&[UR5nURXS-nURURUR5nURRXR-5 UR5up4nUS-S:wa[X4U5eX4U4$![Ra [S5ef=f)a8Send multiline data and read server response.

Returned value is the same as for 'send_command()' method.

'SSIPDataError' is raised in case of non 2xx return code. See SSIP
documentation for more information about server responses and codes.

'IOError' is raised when the socket was closed by the remote side.

r�Nr�r�r�)r��
startswith�_END_OF_DATA_MARKERr��_END_OF_DATA_MARKER_ESCAPED�replace�_RAW_DOTLINE�_ESCAPED_DOTLINErr��_END_OF_DATAryr�r"r�rb)r)rS�lrQrR�
response_datas      r�	send_data�_SSIP_Connection.send_dataMs����{�{�7�#���?�?�4�3�3�4�4��D�,�,�-�A��3�3�d�2�h�>�D��|�|�D�-�-�t�/D�/D�E��	O��L�L���d�%6�%6�6�7�$(�#6�#6�#8� ��=���9��>���4�0�0��-�'�'���|�|�	O�(�)M�N�N�	O�s�?'C� C2c��Xlg)aRegister a callback function for handling asynchronous events.

Arguments:
  callback -- a callable object (function) which will be called to
    handle asynchronous events (arguments described below).  Passing
    `None' results in removing the callback function and ignoring
    events.  Just one callback may be registered.  Attempts to register
    a second callback will result in the former callback being
    replaced.

The callback function must accept three positional arguments
('message_id', 'client_id', 'event_type') and an optional keyword
argument 'index_mark' (when INDEX_MARK events are turned on).

Note, that setting the callback function doesn't turn the events on.
The user is responsible to turn them on by sending the appropriate `SET
NOTIFICATION' command.

N)r�)r)�callbacks  r�set_callback�_SSIP_Connection.set_callbackns	��("�r)r�r�r�r�rr�N)rrrrrr�r�r�r��_END_OF_DATA_ESCAPEDr�r�rrrrrrrr�r(r�r�r�r�r�r�r�r�rrrrrrrr�s���9��H���"'���1�1�H�<�L�#�&A�A�H�L���1�1�L��"=�=��+�6�6�+�1�1�+�/�/�+�2�2�+�1�1�+�2�2��� +�D
*�!B�H$�(�"��>(�B"rrrc�*�\rSrSrSrSrSrSrSrg)�_CallbackHandleri�z(Internal object which handles callbacks.c�R�Xl0Ul[R"5Ulg�N)�
_client_id�
_callbacksr��Lock�_lock)r)r�s  rr(�_CallbackHandler.__init__�s��#������^�^�%��
rc��X R:wagURR5 URUupVUbX6;a	U"U40UD6 U[R
[R4;a
URU	URR5 g![a N'f=f!URR5 f=fr�)	r�r�r�r�rrr�KeyErrorr�)r)r�r�r�r,r��event_typess       r�__call__�_CallbackHandler.__call__�s������'���
�
����	!�
0�(,����(?�%���&�$�*=��T�,�V�,��L�,�,�l�.A�.A�B�B�����/��J�J��� ���
��
��
�J�J��� �s)�B�AB+�
B(�%B+�'B(�(B+�+Cc���URR5 X#4URU'URR5 g!URR5 f=fr�)r�r�r�r�)r)r�r�r�s    r�add_callback�_CallbackHandler.add_callback�sI���
�
����	!�'/�&=�D�O�O�F�#��J�J��� ��D�J�J��� �s�A�A#)r�r�r�N)	rrrrrr(r�r�rrrrr�r��s��2�&�
!�$!rr�c�"�\rSrSrSrSrSrSrg)r�i�z�An enumeration of valid SSIP command scopes.

The constants of this class should be used to specify the 'scope' argument
for the 'Client' methods.

r)�allrN)rrrrrr�r�rrrrr�r��s����D�L�
�C�Krr�c�,�\rSrSrSrSrSrSrSrSr	Sr
g	)
�Priorityi�z�An enumeration of valid SSIP message priorities.

The constants of this class should be used to specify the 'priority'
argument for the 'Client' methods.  For more information about message
priorities and their interaction, see the SSIP documentation.

�	importantr��message�notification�progressrN)rrrrr�	IMPORTANT�TEXT�MESSAGE�NOTIFICATION�PROGRESSrrrrr�r��s"����I��D��G�!�L��Hrr�c�.�\rSrSrSrSrSrSrSrSr	g)	�PunctuationModei�zcConstants for selecting a punctuation mode.

The mode determines which characters should be read.

r��none�some�mostrN)
rrrrrr��NONE�SOME�MOSTrrrrrr�s+���
�C�*��D�6��D�H��D�rrc�"�\rSrSrSrSrSrSrg)�DataModei�zOConstants specifying the type of data contained within messages
to be spoken.

r��ssmlrN)rrrrrr��SSMLrrrrrr�s����D���D�:rrc���\rSrSrSrSrSrSrS1SjrSr	S	r
S
rSrSr
S
rSrS2SjrSrSrSr\R*4Sjr\R*4Sjr\R*4Sjr\R*4SjrSrS2Sjr\R*4SjrSr\R*4SjrSr\R*4Sjr Sr!\R*4Sjr"\R*4S jr#S!r$\R*4S"jr%S#r&\R*4S$jr'S%r(\R*4S&jr)\R*4S'jr*\R*4S(jr+\R*4S)jr,\R*4S*jr-S+r.S,r/S-r0S.r1S/r2S0r3g)3�
SSIPClienti�aBasic Speech Dispatcher client interface.

This class provides a Python interface to Speech Dispatcher functionality
over an SSIP connection.  The API maps directly to available SSIP commands.
Each connection to Speech Dispatcher is represented by one instance of this
class.

Many commands take the 'scope' argument, thus it is shortly documented
here.  It is either one of 'Scope' constants or a number of connection.  By
specifying the connection number, you are applying the command to a
particular connection.  This feature is only meant to be used by Speech
Dispatcher control application, however.  More datails can be found in
Speech Dispatcher documentation.

Here is a simple example:

from speechd import client
c = client.SSIPClient("mytest")
c.speak("hello, world!")
z	127.0.0.1i�zspeech-dispatcher/speechd.sockNc

���[RRS5n
[RR	S[RR	S[RRU
S555n[RRX�R5n[RUURURS.n
U=(d [RR	S5nU(a!U
RURU55 O�[RR	S5n[R	S55n[RR	S
5nU(aX�S'U(aX}S'OU(aUU
S'U	(aX�S
'OU(aUU
S
'URX�5 URX1U5 g	! S	nN�=f)acInitialize the instance and connect to the server.

Arguments:
  name -- client identification string
  component -- connection identification string.  When one client opens
    multiple connections, this can be used to identify each of them.
  user -- user identification string (user name).  When multi-user
    access is expected, this can be used to identify their connections.
  address -- server address as specified in Speech Dispatcher
    documentation (e.g. "unix:/run/user/joe/speech-dispatcher/speechd.sock"
    or "inet:192.168.0.85:6561")
  autospawn -- a flag to specify whether the library should
    try to start the server if it determines its not already
    running or not

Deprecated arguments:
  method -- communication method to use, one of the constants defined in class
    CommunicationMethod
  socket_path -- for CommunicationMethod.UNIX_SOCKET, socket
    path in filesystem. By default, this is $XDG_RUNTIME_DIR/speech-dispatcher/speechd.sock
    where $XDG_RUNTIME_DIR is determined using the XDG Base Directory
    Specification.
  host -- for CommunicationMethod.INET_SOCKET, server hostname
    or IP address as a string.  If None, the default value is
    taken from SPEECHD_HOST environment variable (if it
    exists) or from the DEFAULT_HOST attribute of this class.
  port -- for CommunicationMethod.INET_SOCKET method, server
    port as number or None.  If None, the default value is
    taken from SPEECHD_PORT environment variable (if it
    exists) or from the DEFAULT_PORT attribute of this class.
 
For more information on client identification strings see Speech
Dispatcher documentation.
�~�XDG_RUNTIME_DIR�XDG_CACHE_HOMEz.cache)r�r�r�r��SPEECHD_ADDRESS�SPEECHD_HOST�SPEECHD_PORTN�SPEECHD_SOCKET�methodr�r�)�os�path�
expanduser�environ�getrA�DEFAULT_SOCKET_PATHrjro�DEFAULT_HOST�DEFAULT_PORT�update�"_connection_arguments_from_addressr��_connect_with_autospawn�_initialize_connection)r)rw�	component�user�address�	autospawnr�r�rr��_home�_runtime_dir�
_sock_path�connection_args�_address�env_speechd_host�env_speechd_port�env_speechd_socket_paths                  rr(�SSIPClient.__init__�sw��N���"�"�3�'���z�z�~�~�&7������HX�Z\�Za�Za�Zf�Zf�gl�nv�Zw�9x�y���W�W�\�\�,�0H�0H�I�
�3F�3R�3R�*4�#'�#4�#4�#'�#4�#4����?�b�j�j�n�n�->�?����"�"�4�#J�#J�8�#T�U�
 "�z�z�~�~�n�=��
(�#&�r�z�z�~�~�n�'E�#F� �')�j�j�n�n�5E�&F�#��,2��)��*.��'�!�*:���'��1<�
�.�(�1H��
�.��$�$�_�@��#�#�D�	�:��#
(�#'� �s�>(G$�$G*c���[S0UD6Ulg![aYnUS:waMURU5 O%![anURU5 UeSnAff=f[S0UD6UlSnAgeSnAff=f)z2Establish new connection (and/or autospawn server)FNr)rr�_connr"�
_server_spawnrgr6)r)r-r)�ce�ses     rr$�"SSIPClient._connect_with_autospawnKsz��	�)�<�O�<�D�J��%�	��E�!���&�&��7��!���/�/��3��H����.�@��@��
�
���	�s:��
A6�A1�6�A1�
A�A�A�A1�0A1�1A6c�^�U<SU<SU<3nURRS[RSU5 URRSSS5upVn[	US5Ul[
UR
5UlURRUR5 [R[R[R[R[R[R4H"nURRSSS	US
5 M$ g)zIInitialize connection -- Set client name, get id, register callbacks etc.�:r��CLIENT_NAME�HISTORY�GET�	CLIENT_IDrr)r�onN)r4r�r�r�r�r�r��_callback_handlerr�rrrrrrr)	r)r'rwr&�	full_namerQrRrS�events	         rr%�!SSIPClient._initialize_connection]s���"&��i�8�	��
�
����u�z�z�=�)�L��*�*�1�1�)�U�K�P���4��d�1�g�,���!1�$�/�/�!B����
�
���� 6� 6�7�"�-�-�"�(�(�"�&�&�"�)�)�"�(�(�"�)�)�+�E�
�J�J�#�#�E�6�>�5�$�O�
+rc�|�0nURS5nUSnXBS'U[R:XaUSUS'U$U[R
:XaUSUS'[
US5US	'U$[S5e! [S5e=f![a U$f=f![a [S
5e[a U$f=f)zVParse a Speech Dispatcher address line and return a dictionary
of connection argumentsr:rzWrong format of server addressr�rr�r�r�r�z<Third parameter of inet_socket address must be a port numberz(Unknown communication method in address.)�splitr"rjro�
IndexErrorrpr�r})r)r(r-�address_params�_methods     rr#�-SSIPClient._connection_arguments_from_addressms���� ���s�+��	K�$�Q�'�G�3:�.�/��)�5�5�5�
�1?��1B��
�.����+�7�7�
7�
�*8��*;���'�*-�n�Q�.?�*@���'���)�)S�T�T��#	K�(�)I�J�J��
�
����
���
m�,�-k�l�l��
����	
�s.�A8�B�B�8
B�
B�B�B;�:B;c�$�UR5 g)zClose the connectionN)r�r0s r�__del__�SSIPClient.__del__�s���
�
�rc�r�USS:Xa�[R"USUS5nUVs/sH
o3SSPM nnSnUH'nURS5(dUS	:XdM!XaS'S
nM) U(d [SUS<S[	U5<S
35e[
R"S5nU(d[Rn[
RRU5(a�/nUR5H0up�U	S;dM
USU	RSS5-[	U
5/-
nM2 [R"US/U-S[R[RS9nUR!5up�UR#5nUS:wa[SU
<35eUR$$[SU-5es snf)z/Attempts to spawn the speech-dispatcher server.r�rmr�r�r�rFz127.z::1Tz@Can't start server automatically (autospawn), requested address z
 resolves on zj which seems to be a remote host. You must start the server manually or choose another connection address.�SPEECHD_CMD)r�z--�_r�z--spawnN)�stdin�stdout�stderrz2Server refused to autospawn, stating this reason: z-Can't find Speech Dispatcher spawn command %s)ry�getaddrinfor�rgr@r�getenvr�
SPD_SPAWN_CMDr�exists�itemsr��
subprocess�Popen�PIPE�communicate�wait�pid)r)r-�	addrinfos�addrinfo�ip_addresses�	localhost�ipr��connection_params�param�value�server�stdout_reply�stderr_reply�retcodes               rr5�SSIPClient._server_spawn�s����1�2�m�C��*�*�?�6�+B�+:�6�+B�D�I�<E�E�9�x�Q�K��N�9�L�E��I�"���=�=��(�(�B�%�K�.0�F�+�"�I�#��!�P_�_e�Of�OR�S_�O`�c�d�d�
�i�i�
�&����%�%�C�
�7�7�>�>�#��� "�� /� 5� 5� 7����	�)�%�$�u�}�}�S��/E�*E�s�5�z�)R�R�%�!8� �%�%�s�I�&6�7H�&H�,0����Q[�Q`�Q`�b�F�)/�);�);�)=�&�L��k�k�m�G��!�|� �[g�!i�j�j��:�:���L�,/�1�2�
2��?Fs�F4c��U[R[R[R[R[R
4;dU5eURRS[RSU5 g)zrSet the priority category for the following messages.

Arguments:
  priority -- one of the 'Priority' constants.

r��PRIORITYN)
r�r�rr�rrr4r�r�r�)r)�prioritys  r�set_priority�SSIPClient.set_priority�si���H�.�.��0@�0@�$�M�M�8�+@�+@�$�-�-�/�/�	9�08�	9�/�	
�
�
����u�z�z�:�x�Hrc���U[R:XaSnO%U[R:XaSnO[SU-5eURRS[RSU5 g)zzSet the data mode for further speech commands.

Arguments:
  value - one of the constants defined by the DataMode class.

r?�offz?Value "%s" is not one of the constants from the DataMode class.r��	SSML_MODEN)rrr�r}r4r�r�r�)r)re�ssip_vals   r�
set_data_mode�SSIPClient.set_data_mode�s\���H�M�M�!��H�
�h�m�m�
#��H��Q����
�	
�
�
����u�z�z�;��Irc���URRS5 URRU5nU(a-[USS5nURRXRU5 U$)a
Say given message.

Arguments:
  text -- message text to be spoken.  This may be either a UTF-8
    encoded byte string or a Python unicode string.
  callback -- a callback handler for asynchronous event notifications.
    A callable object (function) which accepts one positional argument
    `type' and one keyword argument `index_mark'.  See below for more
    details.
  event_types -- a tuple of event types for which the callback should
    be called.  Each item must be one of `CallbackType' constants.
    None (the default value) means to handle all event types.  This
    argument is irrelevant when `callback' is not used.

The callback function will be called whenever one of the events occurs.
The event type will be passed as argument.  Its value is one of the
`CallbackType' constants.  In case of an index mark event, additional
keyword argument `index_mark' will be passed and will contain the index
mark identifier as specified within the text.

The callback function should not perform anything complicated and is
not allowed to issue any further SSIP client commands.  An attempt to
do so would lead to a deadlock in SSIP communication.

This method is non-blocking;  it just sends the command, given
message is queued on the server and the method returns immediately.

�SPEAKr�r)r4r�r�r�r@r�)r)r�r�r��resultr�s      r�speak�SSIPClient.speak�s\��:	
�
�
����(����%�%�d�+�������1��&�F�
�"�"�/�/��+�N��
rc�\�URRSURSS55 g)aSay given character.

Arguments:
  char -- a character to be spoken.  Either a Python unicode string or
    a UTF-8 encoded byte string.

This method is non-blocking;  it just sends the command, given
message is queued on the server and the method returns immediately.

�CHARr��spaceN)r4r�r�)r)�chars  rr~�SSIPClient.char�s#��	
�
�
�������S�'�(B�Crc�<�URRSU5 g)z�Say given key name.

Arguments:
  key -- the key name (as defined in SSIP); string.

This method is non-blocking;  it just sends the command, given
message is queued on the server and the method returns immediately.

�KEYN�r4r�)r)�keys  rr��SSIPClient.key	s��	
�
�
����s�+rc�<�URRSU5 g)z�Output given sound_icon.

Arguments:
  sound_icon -- the name of the sound icon as defined by SSIP; string.

This method is non-blocking; it just sends the command, given message
is queued on the server and the method returns immediately.

�
SOUND_ICONNr�)r)�
sound_icons  rr��SSIPClient.sound_icons��	
�
�
����j�9rc�<�URRSU5 g)z{Immediately stop speaking and discard messages in queues.

Arguments:
  scope -- see the documentation of this class.
    
rNr��r)�scopes  rr�SSIPClient.cancel!s��	
�
�
����%�0rc�<�URRSU5 g)zuImmediately stop speaking the currently spoken message.

Arguments:
  scope -- see the documentation of this class.

r�Nr�r�s  r�stop�SSIPClient.stop+s��	
�
�
�����.rc�<�URRSU5 g)aPause speaking and postpone other messages until resume.

This method is non-blocking.  However, speaking can continue for a
short while even after it's called (typically to the end of the
sentence).

Arguments:
  scope -- see the documentation of this class.

rNr�r�s  rr�SSIPClient.pause4s��	
�
�
�����/rc�<�URRSU5 g)z�Resume speaking of the currently paused messages.

This method is non-blocking.  However, speaking can continue for a
short while even after it's called (typically to the end of the
sentence).

Arguments:
  scope -- see the documentation of this class.

rNr�r�s  rr
�SSIPClient.resumeAs��	
�
�
����%�0rc�D�URRSS5upnU$)z@Return names of all active output modules as a tuple of strings.�LIST�OUTPUT_MODULESr�rPs    r�list_output_modules�SSIPClient.list_output_modulesNs"���*�*�1�1�&�:J�K���4��rc��SS/nU(a)URU5 U(aURU5 URR"U6upEnSn[	UVs/sH
o�"U5PM sn5$![a gf=fs snf)a{Return names of all available voices for the current output module.

If language (possibly even variant) is set, only the list matching that
language (possibly even variant) is returned.

Returns a tuple of tripplets (name, language, variant).

'name' is a string, 'language' is an ISO 639-1 Alpha-2/3 language code
and 'variant' is a string.  Language and variant may be None.

r��SYNTHESIS_VOICESrc�j�[URSS55upnX=(d SU=(d S4$)N�	r�)r��rsplit)�itemrw�lang�variants    rrE�/SSIPClient.list_synthesis_voices.<locals>.spliths/��"'����D�!�(<�"=��D���,�$���4�8�8r)r?r4r�r[r�)	r)�languager�r_rQrRrSrEr�s	         r�list_synthesis_voices� SSIPClient.list_synthesis_voicesSs���	��1�2�G�����x�(���N�N�7�+�"�j�j�5�5�w�?�O�D�t�	9��d�3�d�d�e�D�k�d�3�4�4�� �	��	��
4s�AA6�B�6
B�Bc�n�[U[5(deURRSUSU5 g)z�Switch to a particular language for further speech commands.

Arguments:
  language -- two/three letter language code according to RFC 1766 as string, possibly with a region qualification.
  scope -- see the documentation of this class.
    
r��LANGUAGEN)r�r@r4r�)r)r�r�s   r�set_language�SSIPClient.set_languagems/���(�C�(�(�(�(��
�
����u�j�(�Crc�Z�URRSS5upnU(aUS$g)zGet the current language.r=r�rNr�rPs    r�get_language�SSIPClient.get_languagexs+���*�*�1�1�%��D���4����7�N�rc�@�URRSUSU5 g)z�Switch to a particular output module.

Arguments:
  name -- module (string) as returned by 'list_output_modules()'.
  scope -- see the documentation of this class.

r��
OUTPUT_MODULENr�)r)rwr�s   r�set_output_module�SSIPClient.set_output_modules��	
�
�
����u�o�t�Drc�Z�URRSS5upnU(aUS$g)zGet the current output module.r=r�rNr�rPs    r�get_output_module�SSIPClient.get_output_module�s+���*�*�1�1�%��I���4����7�N�rc��[U[5(aSUs=::aS::dU5e U5eURRSUSU5 g)aTSet the pitch for further speech commands.

Arguments:
  value -- integer value within the range from -100 to 100, with 0
    corresponding to the default pitch of the current speech synthesis
    output module, lower values meaning lower pitch and higher values
    meaning higher pitch.
  scope -- see the documentation of this class.
  
���r�r��PITCHN�r�r�r4r��r)rer�s   r�	set_pitch�SSIPClient.set_pitch�sN���%��%�%�$�%�*>�3�*>�E��E�>�*>�E��E�>��
�
����u�g�u�=rc�Z�URRSS5upnU(aUS$g)zGet the current pitch.r=r�rNr�rPs    r�	get_pitch�SSIPClient.get_pitch�s+���*�*�1�1�%��A���4����7�N�rc��[U[5(aSUs=::aS::dU5e U5eURRSUSU5 g)alSet the pitch range for further speech commands.

Arguments:
  value -- integer value within the range from -100 to 100, with 0
    corresponding to the default pitch range of the current speech synthesis
    output module, lower values meaning lower pitch range and higher values
    meaning higher pitch range.
  scope -- see the documentation of this class.
  
r�r�r��PITCH_RANGENr�r�s   r�set_pitch_range�SSIPClient.set_pitch_range�sN���%��%�%�$�%�*>�3�*>�E��E�>�*>�E��E�>��
�
����u�m�U�Crc��[U[5(aSUs=::aS::de eURRSUSU5 g)amSet the speech rate (speed) for further speech commands.

Arguments:
  value -- integer value within the range from -100 to 100, with 0
    corresponding to the default speech rate of the current speech
    synthesis output module, lower values meaning slower speech and
    higher values meaning faster speech.
  scope -- see the documentation of this class.
    
r�r�r��RATENr�r�s   r�set_rate�SSIPClient.set_rate�sD���%��%�%�$�%�*>�3�*>�>�>�*>�>�>��
�
����u�f�e�<rc�Z�URRSS5upnU(aUS$g)z$Get the current speech rate (speed).r=r�rNr�rPs    r�get_rate�SSIPClient.get_rate�s+���*�*�1�1�%��@���4����7�N�rc��[U[5(aSUs=::aS::de eURRSUSU5 g)a?Set the speech volume for further speech commands.

Arguments:
  value -- integer value within the range from -100 to 100, with 100
    corresponding to the default speech volume of the current speech
    synthesis output module, lower values meaning softer speech.
  scope -- see the documentation of this class.
    
r�r�r��VOLUMENr�r�s   r�
set_volume�SSIPClient.set_volume�sD���%��%�%�$�%�*>�3�*>�>�>�*>�>�>��
�
����u�h��>rc�Z�URRSS5upnU(aUS$g)zGet the speech volume.r=r�rNr�rPs    r�
get_volume�SSIPClient.get_volume�s+���*�*�1�1�%��B���4����7�N�rc���U[R[R[R[R4;dU5eUR
R
SUSU5 g)z�Set the punctuation pronunciation level.

Arguments:
  value -- one of the 'PunctuationMode' constants.
  scope -- see the documentation of this class.
    
r��PUNCTUATIONN)rr�r
r	rr4r�r�s   r�set_punctuation�SSIPClient.set_punctuation�sa����,�,�o�.B�.B�(�-�-��/C�/C�E�E�	L�FK�	L�E��
�
����u�m�U�Crc�Z�URRSS5upnU(aUS$g)z(Get the punctuation pronunciation level.r=r�rNr�rPs    r�get_punctuation�SSIPClient.get_punctuation�s+���*�*�1�1�%��G���4����7�N�rc��US;deUS:XaURRSUSS5 gURRSUSS5 g)z�Toggle the spelling mode or on off.

Arguments:
  value -- if 'True', all incoming messages will be spelled
    instead of being read as normal words. 'False' switches
    this behavior off.
  scope -- see the documentation of this class.
    
)TFTr��SPELLINGr?rqNr�r�s   r�set_spelling�SSIPClient.set_spelling�sI���
�%�%�%��D�=��J�J�#�#�E�5�*�d�C��J�J�#�#�E�5�*�e�Drc�P�US;deURRSUSU5 g)anSet capital letter recognition mode.

Arguments:
  value -- one of 'none', 'spell', 'icon'. None means no signalization
    of capital letters, 'spell' means capital letters will be spelled
    with a synthetic voice and 'icon' means that the capital-letter icon
    will be prepended before each capital letter.
  scope -- see the documentation of this class.
    
)r�spell�iconr��CAP_LET_RECOGNNr�r�s   r�set_cap_let_recogn�SSIPClient.set_cap_let_recogn�s,���1�1�1�1��
�
����u�.>��Frc��[U[5(aUR5S;deURR	SUSU5 g)a�Set voice by a symbolic name.

Arguments:
  value -- one of the SSIP symbolic voice names: 'MALE1' .. 'MALE3',
    'FEMALE1' ... 'FEMALE3', 'CHILD_MALE', 'CHILD_FEMALE'
  scope -- see the documentation of this class.

Symbolic voice names are mapped to real synthesizer voices in the
configuration of the output module.  Use the method
'set_synthesis_voice()' if you want to work with real voices.
    
)�male1�male2�male3�female1�female2�female3�
child_male�child_femaler��
VOICE_TYPEN)r�r@�lowerr4r�r�s   r�	set_voice�SSIPClient.set_voice
sH���%��%�%��{�{�}�!1�1�	1�1�	
�
�
����u�l�E�Brc�@�URRSUSU5 g)z�Set voice by its real name.

Arguments:
  value -- voice name as returned by 'list_synthesis_voices()'
  scope -- see the documentation of this class.
    
r��SYNTHESIS_VOICENr�r�s   r�set_synthesis_voice�SSIPClient.set_synthesis_voice s��	
�
�
����u�.?��Grc�n�[U[5(deURRSUSU5 g)aSet the amount of context when resuming a paused message.

Arguments:
  value -- a positive or negative value meaning how many chunks of data
    after or before the pause should be read when resume() is executed.
  scope -- see the documentation of this class.
    
r��
PAUSE_CONTEXTNr�r�s   r�set_pause_context�SSIPClient.set_pause_context*s/���%��%�%�%�%��
�
����u�o�u�Erc��[U[5(deUS:XaSnOSnURRS[R
SU5 g)a�Switch debugging on and off. When switched on,
debugging files will be created in the chosen destination
(see set_debug_destination()) for Speech Dispatcher and all
its running modules. All logging information will then be
written into these files with maximal verbosity until switched
off. You should always first call set_debug_destination.

The intended use of this functionality is to switch debugging
on for a period of time while the user will repeat the behavior
and then send the logs to the appropriate bug-reporting place.

Arguments:
  val -- a boolean value determining whether debugging
         is switched on or off
  scope -- see the documentation of this class.

T�ON�OFFr��DEBUGN)r��boolr4r�r�r�)r)�valrss   r�	set_debug�SSIPClient.set_debug6sD��$�#�t�$�$�$�$��$�;��H��H��
�
����u�y�y�'�8�Drc��[U[5(deURRS[R
SU5 g)z�Set debug destination.

Arguments:
  path -- path (string) to the directory where debugging
          files will be created
  scope -- see the documentation of this class.

r��DEBUG_DESTINATIONN)r�r@r4r�r�r�)r)rs  r�set_debug_destination� SSIPClient.set_debug_destinationQs4���$��$�$�$�$��
�
����u�y�y�2E�t�Lrc�<�URRSS5 g)zMBegin an SSIP block.

See SSIP documentation for more details about blocks.

�BLOCKrNr�r0s r�block_begin�SSIPClient.block_begin^s��	
�
�
�����1rc�<�URRSS5 g)zMClose an SSIP block.

See SSIP documentation for more details about blocks.

rrNr�r0s r�	block_end�SSIPClient.block_endfs��	
�
�
�����/rc�`�[US5(aURR5 U?gg)z*Close the connection to Speech Dispatcher.r4N)�hasattrr4r�r0s rr��SSIPClient.closens)���4��!�!��J�J�����
�"r)r@r�r4)�default�unknownNNNNNNrE)4rrrrrr r!rr(r$r%r#rKr5rnrtryr~r�r�r�r�rr�rr
r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr�rrrrrr�s����*�L�.��L�5�:��7�JN��@D�M;�^�$P� �6�*2�X
I�J�"%�ND�
,�
:�!�:�:�1����/� �*�*�0�!�:�:�1��
5�4,1�:�:�	D��-2�J�J�E��&+�Z�Z�>��,1�:�:�D�%*�J�J�=��',�j�j�?��,1�:�:�
D��).�
�
�E� /4�j�j�G�&+�Z�Z�C�&05�z�z�H�.3�Z�Z�
F�E�6M�2�0�rrc��^�\rSrSrSrS	U4Sjjr\R4Sjr\R4U4Sjjr
\R4U4Sjjr\R4U4SjjrSr
U=r$)
�ClientiuaA DEPRECATED backwards-compatible API.

This Class is provided only for backwards compatibility with the previous
unofficial API.  It will be removed in future versions.  Please use either
'SSIPClient' or 'Speaker' interface instead.  As deprecated, the API is no
longer documented.

c�X>�U=(d U=(d Sn[[U]
"U40UD6 g)N�python)r'rr()r)rw�clientr,r-s    �rr(�Client.__init__~s&����)�v�)���
�f�d�$�T�4�V�4rc�H�URU5 URU5 gr�)rnry)r)r�rms   r�say�
Client.say�s�����(�#��
�
�4�rc�N>�URU5 [[U]U5 gr�)rnr'rr~)r)r~rmr-s   �rr~�Client.char�s ������(�#�
�f�d� ��&rc�N>�URU5 [[U]U5 gr�)rnr'rr�)r)r�rmr-s   �rr��
Client.key�s ������(�#�
�f�d���$rc�N>�URU5 [[U]U5 gr�)rnr'rr�)r)r�rmr-s   �rr��Client.sound_icon�s ������(�#�
�f�d�&�z�2rrrE)rrrrrr(r�rrr�r~r�r�rrFrGs@rrrusL����5�"*�!1�!1��#+�-�-�'�!)�
�
�%�/7�m�m�3�3rrc��\rSrSrSrSrg)�Speakeri�a�Extended Speech Dispatcher Interface.

This class provides an extended intercace to Speech Dispatcher
functionality and tries to hide most of the lower level details of SSIP
(such as a more sophisticated handling of blocks and priorities and
advanced event notifications) under a more convenient API.

Please note that the API is not yet stabilized and thus is subject to
change!  Please contact the authors if you plan using it and/or if you have
any suggestions.

Well, in fact this class is currently not implemented at all.  It is just a
draft.  The intention is to hide the SSIP details and provide a generic
interface practical for screen readers.

rNr rrrrr�s��rrc�"�\rSrSrSrSrSrSrg)�ConnectionMethodi�z�Constants describing the possible methods of connection to server.

Retained for backwards compatibility but DEPRECATED. See CommunicationMethod.rlrmrNrnrrrrr�s��U� �K�;��K�9rr)rryrrX�time�tempfiler��dummy_threading�r�objectrrLrr"rIr[rbrgrjrrr�r�r�rrrrrrrrr�<module>r%s�� �.�-�-�(���)�6�)�.F�	�F�,�Y�,�\
�	�
� �(���%��1��1�:�&�:�l"�v�l"�\!�v�!�B
L�F�
L��v���f��&;�v�;�S
��S
�l3�Z�3�<�j��,:�v�:��U$(�'�s�C)�)C1

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 556 B 0644
_test.cpython-313.pyc File 7.02 KB 0644
client.cpython-313.pyc File 53.25 KB 0644
paths.cpython-313.pyc File 193 B 0644
Filemanager