%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/words/im/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/words/im/__pycache__/ircsupport.cpython-312.pyc

�

Ϫ�f$��r�dZddlmZddlmZmZmZddlmZddl	m
Z
mZmZddl
mZddlmZGd�d	e
j"�Zeej&�Gd
�de
j(��ZGd�d
e
j,ej.�Zeej2�Gd�de
j4��Zy)z%
IRC support for Instance Messenger.
�)�implementer)�defer�protocol�reactor)�succeed)�basesupport�
interfaces�locals��ONLINE)�ircc�,�eZdZd�Zd�Zd�Zd�Zdd�Zy)�	IRCPersonc��|jj�tj�|jjj	d|j
z�y)NzWHOIS %s��account�clientr
�OfflineError�sendLine�name��selfs �=/usr/lib/python3/dist-packages/twisted/words/im/ircsupport.py�imperson_whoiszIRCPerson.imperson_whoiss?���<�<���&��%�%�%������$�$�Z�$�)�)�%;�<�c��tS�Nrrs r�isOnlinezIRCPerson.isOnline����
rc��tSrrrs r�	getStatuszIRCPerson.getStatusrrc�d�||_|jj�j|�yr)�status�chat�getContactsList�setContactStatus)rr#s  r�	setStatuszIRCPerson.setStatuss$������	�	�!�!�#�4�4�T�:rNc��|jj�tj�|j	d�D]}}|rI|jdd�dk(r4|jjj
|jd|fg��N|jjj|j|��t|�S)N�
�style�emote�ACTION)
rrr
r�split�get�
ctcpMakeQueryr�msgr�r�text�meta�lines    r�sendMessagezIRCPerson.sendMessage"s����<�<���&��%�%�%��J�J�t�$�	9�D������$�/�7�:����#�#�1�1�$�)�)�x��>N�=O�P����#�#�'�'��	�	�4�8�		9�
�t�}�rr)�__name__�
__module__�__qualname__rrr!r'r5�rrrrs��=���;�rrc�.�eZdZd�Zd�Zd�Zifd�Zd�Zy)�IRCGroupc��yrr9rs r�imgroup_testActionzIRCGroup.imgroup_testAction/���rc���|jj�tj�d}|jjj	d|j
�d|j
�d|���y)Nzfor great justice!zKICK #� z :r)r�target�reasons   r�
imtarget_kickzIRCGroup.imtarget_kick2sV���<�<���&��%�%�%�%�������$�$�v�d�i�i�[��&�+�+��b���%Q�Rrc��|jj�tj�|jjj	|j
|�yr)rrr
r�topicr)rrEs  r�setTopiczIRCGroup.setTopic9s<���<�<���&��%�%�%������!�!�$�)�)�U�3rc��|jj�tj�|rS|j	dd�dk(r>|jjj|jd|fg�t|�S|jd�D]2}|jjj|j|��4t|�S)Nr*r+r,r))
rrr
rr.r/rrr-�sayr1s    r�sendGroupMessagezIRCGroup.sendGroupMessage>s����<�<���&��%�%�%��D�H�H�W�d�+�w�6��L�L���-�-�d�i�i�8�T�:J�9K�L��4�=� ��J�J�t�$�	5�D��L�L���#�#�D�I�I�t�4�	5��t�}�rc��|jj�tj�|jjj	|j
�|jjj
|j
d�y�N�)rrr
r�leaver�getGroupConversationrs rrMzIRCGroup.leaveIsX���<�<���&��%�%�%������!�!�$�)�)�,������0�0����A�>rN)r6r7r8r=rCrFrIrMr9rrr;r;-s!��
�S�4�
+-�	�?rr;c��eZdZdd�Zdd�Zd�Zd�Zd�Zd�Zd�Z	d	�Z
dd
�Zd�Zd�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�IRCProtoNc��tjj||||�i|_i|_i|_i|_yr)r�AbstractClientMixin�__init__�_namreplies�	_ingroups�_groups�_topics)rr�chatui�
logonDeferreds    rrSzIRCProto.__init__Qs9���'�'�0�0��w��
�V������������rc��|j�}|jj|jj||�|��S)N)�
stayHidden)�lowerr$rN�getGroup)rr�hides   rrNzIRCProto.getGroupConversationXs?���z�z�|���y�y�-�-��I�I���t�T�*�t�.�
�	
rc�:�|jj||�Sr)r$�	getPerson�rrs  rr`zIRCProto.getPerson^s���y�y�"�"�4��.�.rc��	d|_|jj|_|jj|_d|_tjj|�|jjD]}|j|��d|j_|j�|jj|�|jj�y#t $rddl}|j%�YywxYw)NTzTwisted-IM userrLr)�performLoginr�username�nickname�password�realnamer
�	IRCClient�connectionMade�channels�	joinGroup�	_isOnline�_logonDeferred�callbackr$r%�
BaseException�	traceback�	print_exc)r�channelrps   rrizIRCProto.connectionMadeas���	"� $�D�� �L�L�1�1�D�M� �L�L�1�1�D�M�-�D�M��M�M�(�(��.��<�<�0�0�
(�����w�'�
(�%&�D�L�L�"��"�"�.��#�#�,�,�T�2��I�I�%�%�'���	"�����!�	"�s�C!C$�$D�Dc�f�||_d|z|_tjj	||�y)Nz%s (IRC))r�accountNamer
rh�setNick)r�nicks  rruzIRCProto.setNickvs*����	�%��,����
�
���d�D�)rc�t�|jj|jj|dd|�d�S)z9
        Called when I am kicked from a channel.
        rLN)r$rNr])rrr�kicker�messages    r�
kickedFromzIRCProto.kickedFrom{s3���y�y�-�-�d�i�i�.@�.@�����d�.S�UV�W�Wrc��yrr9)r�kickeerrrxrys     r�
userKickedzIRCProto.userKicked�r>rc�0�|j|||ddi�y)N�dontAutoRespondrL)�privmsg)rrdrrrys    r�noticedzIRCProto.noticed�s�����X�w��2C�Q�1G�Hrc�*�|�i}|jdd�d}||jk(ry|ddk(r(|dd}|j|�j|||�y|jj|j
|��j||�y)N�!rLr�#�r-rrN�showGroupMessager$�getConversationr`�showMessage)rrdrrry�metadata�groups      rr�zIRCProto.privmsg�s������H��>�>�#�q�)�!�,���t�y�y� ���1�:����A�B�K�E��%�%�e�,�=�=��'�8�
�
��	�	�!�!�$�.�.��":�;�G�G��X�	
rc�*�|jdd�d}||jk(ryddi}|ddk(r(|dd}|j|�j|||�y|jj|j
|��j||�y)Nr�rLrr*r+r�r�)rrdrrr+r3r�s      r�actionzIRCProto.action�s����>�>�#�q�)�!�,���t�y�y� ����!���1�:����A�B�K�E��%�%�e�,�=�=�h��t�T���	�	�!�!�$�.�.��":�;�G�G��t�Trc���|dddj�}|dj�}tt|��D]#}||ddvs�||dd||<||ddvr��%||jvrg|j|<|j|j|�|D]!}	|j|j|��#y#t$r|g|j|<Y�@wxYw)z�
        RPL_NAMREPLY
        >> NAMES #bnl
        << :Arlington.VA.US.Undernet.Org 353 z3p = #bnl :pSwede Dan-- SkOyg AG
        �rLN�r)�@�+)	r\r-�range�lenrT�extendrU�appendro)r�prefix�paramsr��users�uires       r�irc_RPL_NAMREPLYzIRCProto.irc_RPL_NAMREPLY�s����q�	�!�"�
�#�#�%���q�	���!����E�
�#�	*�B���)�A�,�*�,�!�"�I�a�b�M��b�	���)�A�,�*�,�	*���(�(�(�&(�D���U�#������&�&�u�-��	3�H�
3����x�(�/�/��6�	3��!�
3�,1�7����x�(�
3�s�%C�C"�!C"c��|ddd}|j|�j|j|j��|j|j�=yrK)rN�setGroupMembersrTr\�rr�r�r�s    r�irc_RPL_ENDOFNAMESzIRCProto.irc_RPL_ENDOFNAMES�sT���q�	�!�"�
���!�!�%�(�8�8����U�[�[�]�+�	
�
���U�[�[�]�+rc�4�|d|j|ddd<y)Nr�rL)rW)rr�r�s   r�
irc_RPL_TOPICzIRCProto.irc_RPL_TOPIC�s��&,�Q�i����V�A�Y�q�r�]�#rc��|ddd}|j|�j|j||d�|j|=y)NrLr�)rNrFrWr�s    r�irc_333zIRCProto.irc_333�sE���q�	�!�"�
���!�!�%�(�1�1�$�,�,�u�2E�v�a�y�Q��L�L��rc��|jd�d}|ddd}|d}|j|�j||�y�Nr�rrL)r-rNrF)rr�r�rer�rEs      r�	irc_TOPICzIRCProto.irc_TOPIC�sH���<�<��$�Q�'���q�	�!�"�
���q�	���!�!�%�(�1�1�%��Brc�4�|jd�d}|dddj�}||jk7r@	|j|j	|�|j
|�j|�yy#t
$r|g|j|<Y�=wxYwr�)r-r\rerUr�rorN�memberJoined�rr�r�rer�s     r�irc_JOINzIRCProto.irc_JOIN�s����<�<��$�Q�'���q�	�!�"�
�#�#�%���t�}�}�$�
3����x�(�/�/��6�
�%�%�e�,�9�9�(�C�%��!�
3�,1�7����x�(�
3�s�A;�;B�Bc��|jd�d}|dddj�}||jk7rQ||j|vr?|j|j	|�|j|�j
|�yyyr�)r-r\rerU�removerN�
memberLeftr�s     r�irc_PARTzIRCProto.irc_PART�s����<�<��$�Q�'���q�	�!�"�
�#�#�%���t�}�}�$�����x�0�0����x�(�/�/��6��)�)�%�0�;�;�H�E�1�%rc���|jd�d}||jvrD|j|D]"}|j|�j|��$g|j|<yy�Nr�r)r-rUrNr�r�s     r�irc_QUITzIRCProto.irc_QUIT�sg���<�<��$�Q�'���t�~�~�%�����1�
F���)�)�%�0�;�;�H�E�
F�')�D�N�N�8�$�&rc��|jd�d}|d}||jvry|j|D]#}|j|�j||��%|j||j|<|j|=yr�)r-rUrN�memberChangedNick)rr�r��fromNick�toNickr�s      r�irc_NICKzIRCProto.irc_NICK�s����<�<��$�Q�'�������4�>�>�)���^�^�H�-�	Q�E��%�%�e�,�>�>�x��P�	Q�!%����!9����v���N�N�8�$rc��yrr9)rr��commandr�s    r�irc_unknownzIRCProto.irc_unknown�r>rc�H�|j|�|j|�yr)�joinrNras  rrkzIRCProto.joinGroup�s���	�	�$���!�!�$�'rr)r)r6r7r8rSrNr`rirurzr}r�r�r�r�r�r�r�r�r�r�r�r�r�rkr9rrrPrPPsq���
�/�"�**�
X�
�I�
� 	U�3�(,�0� �
C�D�F�*�%�
�(rrPc�.�eZdZdZeZeZ	dd�Zd�Z	d�Z
y)�
IRCAccount�IRCc	���tjj|||||||�|jd�D�cgc]}|j	���c}|_|j
dgk(rg|_yycc}w)N�,�)r�AbstractAccountrSr-�striprj)	rrt�	autoLoginrdrf�host�portrjrrs	         rrSzIRCAccount.__init__�sk��	�#�#�,�,��+�y�(�H�d�D�	
�9A���s�8K�L�W�����L��
��=�=�R�D� ��D�M�!��Ms�A1c���tj�}tjtt
|||�}|j
|j|j�}|j|j�|Sr)r�Deferredr�
ClientCreatorrrP�
connectTCPr�r��
addErrback�errback)rrXrY�cc�ds     r�_startLogOnzIRCAccount._startLogOnsV�����(�
�
�
#�
#�G�X�t�V�]�
S���M�M�$�)�)�T�Y�Y�/��	���]�*�*�+��rc��yrr9rs r�logOffzIRCAccount.logOffs��rN)r�)r6r7r8�gatewayTyper;�
_groupFactoryr�_personFactoryrSr�r�r9rrr�r��s'���K��M��N�PR���
rr�N)�__doc__�zope.interfacer�twisted.internetrrr�twisted.internet.deferr�twisted.words.imrr	r
�twisted.words.im.localsr�twisted.words.protocolsr
�AbstractPersonr�IGroup�
AbstractGroupr;rRrhrP�IAccountr�r�r9rr�<module>r�s����'�5�5�*�<�<�*�'���*�*��8
�Z�
�
��?�{�(�(�?� �?�Dd(�{�.�.��
�
�d(�N
�Z�
 �
 �!�
��,�,�
�"�
r

Zerion Mini Shell 1.0