Your IP : 3.22.68.228


Current Path : /opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/__pycache__/nntplib.cpython-312.opt-2.pyc

�

�Q�f����	ddlZddlZddlZddlZddlZddlZ	ddlZdZddl	m
ZddlmZgd�Z
ejed��d	ZGd
�de�ZGd�d
e�ZGd�de�ZGd�de�ZGd�de�ZGd�de�ZdZdZhd�Zgd�Zddd�ZdZej<dgd��Zej<d gd!��Z d"�Z
d#�Z!dVd$�Z"dVd%�Z#dWd&�Z$erd'�Z%Gd(�d)�Z&erGd*�d+e&�Z'e
jQd+�ed,k(�r�ddl)Z)e)jTd-�.�Z+e+jYd/d0d1d2�3�e+jYd4d5d6d7�3�e+jYd8d9d:e-d;e�d<e�d=��>�e+jYd?d@dAe-dB�>�e+jYdCdDdEddF�G�e+j]�Z/e/j`Z0e/jse0d:k(reZ0e&e/jbe0�H�Z2ne0d:k(reZ0e'e/jbe0�H�Z2e2jg�Z4dIe4vre2jk�e2jme/jl�\Z7Z8Z9Z:Z;e<dJe;dKe8dLe9dMe:�dN�Z=e>e-e:�e/j~z
dOz�Z9e2j�e9e:�\Z7ZAeAD]a\ZBZCe
eCdP�j�dQdO�dZEe
eCdR�ZFe-eCd�ZGe<dSj�eBe=eEdT�e=eFdU�eG���ce2j��yy#e$rdZY���wxYw)X�NTF)�
decode_header)�_GLOBAL_DEFAULT_TIMEOUT)�NNTP�	NNTPError�NNTPReplyError�NNTPTemporaryError�NNTPPermanentError�NNTPProtocolError�
NNTPDataErrorr)��
)�removeic��eZdZ	d�Zy)rc�r�tj|g|���	|d|_y#t$r
d|_YywxYw)NrzNo response given)�	Exception�__init__�response�
IndexError)�self�argss  �./opt/alt/python312/lib64/python3.12/nntplib.pyrzNNTPError.__init__es;�����4�'�$�'�	0� ��G�D�M���	0�/�D�M�	0�s�
#�6�6N)�__name__�
__module__�__qualname__r��rrrcs
��/�0rrc��eZdZ	y)rN�rrrrrrrrls��"�rrc��eZdZ	y)rNrrrrrrp����rrc��eZdZ	y)r	Nrrrrr	r	tr rr	c��eZdZ	y)r
Nrrrrr
r
xs��,�rr
c��eZdZ	y)rNrrrrrr|s�� �rr�wi3>�100�101�211�215�220�221�222�224�225�230�231�282)�subject�from�datez
message-id�
references�:bytes�:linesr5r6)�bytes�lines�
�	GroupInfo)�group�last�first�flag�ArticleInfo)�number�
message_idr8c���	g}t|�D]K\}}t|t�r%|j|j	|xsd���;|j|��Mdj|�S)N�ascii�)�_email_decode_header�
isinstancer7�append�decode�join)�
header_str�parts�v�encs    rrr�s^��@��E�&�z�2���3��a����L�L����#�.��1�2��L�L��O�	3�
�7�7�5�>�rc��	g}|D]t}|ddk(r|ddjd�\}}}d|z}n|jd�\}}}|j�}tj||�}|j	|��vt
}t
|�t
|�krtd��|dt
|�|k7rtd��|S)Nr�:�z$LIST OVERVIEW.FMT response too shortz*LIST OVERVIEW.FMT redefines default fields)�	partition�lower�_OVERVIEW_FMT_ALTERNATIVES�getrG�_DEFAULT_OVERVIEW_FMT�lenr)r8�fmt�line�name�_�suffix�defaultss       r�_parse_overview_fmtr]�s���$�
�C�����7�c�>�"�1�2�h�0�0��5�O�D�!�V���:�D�#�n�n�S�1�O�D�!�V��z�z�|��)�-�-�d�D�9���
�
�4���%�H�
�3�x�#�h�-���B�C�C�
�>�C��M��h�&��H�I�I��Jrc��	tt�}g}|D]�}i}|jd�^}}t|�}t	|�D]|\}	}
|	t|�k\r�||	}|jd�}|	|k\rE|sC|dz}
|
r*|
dt|
�j
�|
k7rtd��|
r|
t|
�dnd}
|
|||	<�~|j||f���|S)N�	rOz: z?OVER/XOVER response doesn't include names of additional headers)	rVrU�split�int�	enumerate�
startswithrRrrG)r8rW�data_process_func�
n_defaults�overviewrX�fields�article_number�tokens�i�token�
field_name�is_metadata�hs              r�_parse_overviewro�s����*�+�J��H�����"&�*�*�T�"2�����^�,��!�&�)�H�A�u��C��H�}���Q��J�$�/�/��4�K��J��{���%���U�7�C��F�^�1�1�3�q�8�'�)F�G�G�*/��c�!�f�g��T��"�F�3�q�6�N�!*�"	�����0�1�+�,�Orc�"�	|�
|dd}|dd}t|dd�}t|dd�}t|dd�}t|dd�}t|dd�}t|dd�}|dkr|dz
}n
|dkr|d	z
}tj||||||�S)
Ni�������������Fi��dil)ra�datetime)�date_str�time_str�hours�minutes�seconds�year�month�days        r�_parse_datetimer��s�������B�C�=���C�R�=�����!���E��(�1�Q�-� �G��(�1�2�,��G��x���}��D����B�� �E�

�h�r�s�m�
�C��b�y�����	
����������T�5�#�u�g�w�G�Grc���	t|tj�sd}ndj|�}|j}|r|dz}dj||�}||fSdj||�}||fS)N�000000z({0.hour:02d}{0.minute:02d}{0.second:02d}rvz{0:02d}{1.month:02d}{1.day:02d}z{0:04d}{1.month:02d}{1.day:02d})rFrw�formatr})�dt�legacyry�yrxs     r�_unparse_datetimer�s�����b�(�+�+�,���=�D�D�R�H��
���A�
�
��G��4�;�;�A�r�B���X���5�;�;�A�r�B���X��rc�V�	|�tj�}|j||��S)N)�server_hostname)�ssl�_create_stdlib_context�wrap_socket)�sock�context�hostnames   r�_encrypt_onr�s2��	��?��0�0�2�G��"�"�4��"�B�Brc��eZdZdZdZeddddefd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�ZeZd
�Zd�Zd7d�Zd�Zd8d�Zd�Zd8d�Zd8d�Zd�Zd�Zd�Zdd�d�Zdd�d�Zd8dd�d�Zd�Zd�Zd�Z d�Z!dd�d �Z"d!�Z#d"�Z$d8d#�Z%d$�Z&d%�Z'd8d&�Z(d8dd�d'�Z)d8dd�d(�Z*d8dd�d)�Z+d*�Z,dd�d+�Z-dd�d,�Z.dd�d-�Z/d.�Z0d/�Z1d0�Z2d1�Z3d2�Z4d3�Z5d9d4�Z6d5�Z7e8rd8d6�Z9yy):rzutf-8�surrogateescapeNFc�|�	||_||_|j|�|_d|_	|jjd�|_|j
|�|s|r|j|||�yy#|jr|jj�|jj��xYw)N�rwb)	�host�port�_create_socketr��file�makefile�
_base_init�login�close)rr�r��user�password�
readermode�usenetrc�timeouts        rrz
NNTP.__init__;s���	�"��	���	��'�'��0��	���	�		��	�	�*�*�5�1�D�I��O�O�J�'��x��
�
�4��8�4� ��	��y�y��	�	���!��I�I�O�O���s
�AA8�8AB;c��	d|_|j�|_d|_|j	�d|_|rAd|jvr3|j
�|j
sd|_|j	�d|_d|_y)NrF�READER)	�	debugging�_getresp�welcome�_caps�getcapabilities�readermode_afterauth�_setreadermode�tls_on�
authenticated)rr�s  rr�zNNTP._base_init^s���	�����}�}������
�����%*��!��(�$�*�*�4����!��,�,�!��
��$�$�&�
���#��rc��|S�Nr�rs r�	__enter__zNNTP.__enter__�s���rc�����fd�}|�r*	�j�|�r�j�yyy#ttf$rY�+wxYw#|�r�j�wwxYw)Nc���t�d�S)Nr�)�hasattrr�s�r�<lambda>zNNTP.__exit__.<locals>.<lambda>�s���w�t�V�4r)�quit�OSError�EOFError�_close)rr�is_connecteds`  r�__exit__z
NNTP.__exit__�sd���4���>�
"��	�	�� �>��K�K�M�"�
���X�&�
��
�� �>��K�K�M�"�s!�9�A�A�
A�A�A(c���|�
|std��tjd||j|j�tj|j|jf|�S)Nz0Non-blocking socket (timeout=0) is not supportedznntplib.connect)�
ValueError�sys�auditr�r��socket�create_connection)rr�s  rr�zNNTP._create_socket�sQ����w��O�P�P��	�	�#�T�4�9�9�d�i�i�@��'�'����D�I�I�(>��H�Hrc�r�	|jrtdt|j��|jS)Nz	*welcome*)r��print�reprr�r�s r�
getwelcomezNNTP.getwelcome�s,��	.�
�>�>�5��d�4�<�<�.@�A��|�|�rc�p�	|j�wd|_d|_	|j�\}}||_d|vr!t	tt|d��|_d|vrdj|d�|_|jS|jS#ttf$ri|_Y|jSwxYw)NrP�VERSION�IMPLEMENTATION� )
r��nntp_version�nntp_implementation�capabilities�max�maprarIr	r)r�resp�capss   rr�zNNTP.getcapabilities�s���	��:�:�� !�D��'+�D�$�
P�!�.�.�0�
��d�
"��
���$�),�C��T�)�_�,E�(F�D�%�#�t�+�/2�x�x��=M�8N�/O�D�,��z�z��t�z�z���'�(:�;�
 ���
��z�z��
 �s�B�B5�4B5c��	||_yr�)r�)r�levels  r�set_debuglevelzNNTP.set_debuglevel�s��	H�
��rc��	tjd||�|tz}|jdkDrt	dt|��|jj|�|jj�y)Nznntplib.putlinerPz*put*)	r�r��_CRLFr�r�r�r��write�flush�rrXs  r�_putlinez
NNTP._putline�sX��	3��	�	�#�T�4�0��e�|���>�>�A��u�W�d�4�j�9��	�	������	�	���rc��	|jrtdt|��|j|j|j
�}|j
|�y)Nz*cmd*)r�r�r��encode�encoding�errorsr�r�s  r�_putcmdzNNTP._putcmd�s?��	0��>�>�5��$�t�*�5��{�{�4�=�=�$�+�+�6���
�
�d�rc�(�	|jjtdz�}t|�tkDrt	d��|j
dkDrt
dt|��|st�|r#|ddtk(r|dd}|S|ddtvr|dd}|S)NrPz
line too longz*get*rt���)
r��readline�_MAXLINErVrr�r�r�r�r�)r�
strip_crlfrXs   r�_getlinez
NNTP._getline�s���	#��y�y�!�!�(�A�+�.���t�9�x����0�0��>�>�A���'�4��:�&��8�^���B�C�y�E�!��C�R�y�����b�c��e�#��C�R�y���rc��	|j�}|jrtdt|��|j	|j
|j�}|dd}|dk(rt|��|dk(rt|��|dvrt|��|S)Nz*resp*rP�4�5�123)
r�r�r�r�rHr�r�rr	r
)rr��cs   rr�z
NNTP._getresp�s���	%��}�}����>�>�5��4��:�6��{�{�4�=�=�$�+�+�6����!�H����8�$�T�*�*���8�$�T�*�*��E�>�#�D�)�)��rc��	d}	t|ttf�rt|d�x}}|j	�}|ddt
vrt
|��g}|�Jdtzdf}	|jd�}||vrni|jd�r|dd}|j|��>d}	|j�}||k(rn(|jd�r|dd}|j|��>|r|j�||fS#|r|j�wwxYw)N�wbr�.s.
rPFs..)
rF�strr7�openr��	_LONGRESPrr�r�rcr�rGr�)rr��
openedFiler�r8�terminatorsrX�
terminators        r�_getlongrespzNNTP._getlongresp�s.��	��
� 	#��$��e��-�$(��t�$4�4�
�T��=�=�?�D��B�Q�x�y�(�$�T�*�*��E���#�e�|�V�4����=�=��/�D��{�*�����u�-�#�A�B�x���J�J�t�$�
�"�
���=�=�?�D��z�)�����u�-�#�A�B�x���L�L��&�
��� � �"��U�{����� � �"��s�CC4�4D	c�F�	|j|�|j�Sr�)r�r�r�s  r�	_shortcmdzNNTP._shortcmds��	,����T���}�}��rc�H�	|j|�|j|�Sr�)r�r�)rrXr�s   r�_longcmdz
NNTP._longcmd!s$��	0����T��� � ��&�&rc���	|j|�|j|�\}}||D�cgc](}|j|j|j���*c}fScc}wr�)r�r�rHr�r�)rrXr�r��lists     r�_longcmdstringzNNTP._longcmdstring'si��	�	
���T���&�&�t�,�
��d��"&�(�"&�$��k�k�$�-�-����=�"&�(�(�	(��(s�-Ac��		|jS#t$rYnwxYw	|jd�\}}t|�}n#t$rt
dd}YnwxYw||_|S)NzLIST OVERVIEW.FMT)�_cachedoverviewfmt�AttributeErrorr�r]r	rU)rr�r8rWs    r�_getoverviewfmtzNNTP._getoverviewfmt1sz��	8�	��*�*�*���	��	��	-��-�-�.A�B�K�D�%�
&�e�,�C��	"�	+�'��*�C�	+��
#&����
s��	��?�A�Ac�T�|D�cgc]}t|j����c}Scc}wr�)r:r`)rr8rXs   r�
_grouplistzNNTP._grouplistBs%��5:�;�U�T�	�4�:�:�<�(�U�;�;��;s�%c�t�	i}|jd�\}}|D]}|j�^}}|||<�||fS)N�CAPABILITIES)r�r`)rr�r�r8rXrYris       rr�zNNTP.capabilitiesFsP��	����)�)�.�9���e��D� �J�J�L�M�D�6��D��J���T�z�r)r�c�`�	t|tjtjf�s.tdj	|j
j���t||jdk�\}}dj	||�}|j||�\}}||j|�fS)N�Athe date parameter must be a date or datetime object, not '{:40}'rqzNEWGROUPS {0} {1})rFrwr3�	TypeErrorr��	__class__rr�r�r�r�)rr3r�rxry�cmdr�r8s        r�	newgroupszNNTP.newgroupsTs���	��$�����
�
� >�?���$�f�T�^�^�%<�%<�=�?�
?�/�t�T�5F�5F��5J�K���(�!�(�(��8�<���)�)�#�t�4���e��T�_�_�U�+�+�+rc�6�	t|tjtjf�s.tdj	|j
j���t||jdk�\}}dj	|||�}|j||�S)NrrqzNEWNEWS {0} {1} {2})
rFrwr3rr�rrr�r�r�)rr;r3r�rxryrs       r�newnewszNNTP.newnewsds���	��$�����
�
� >�?���$�f�T�^�^�%<�%<�=�?�
?�/�t�T�5F�5F��5J�K���(�#�*�*�5�(�H�E���"�"�3��-�-rc�h�	|�d|z}nd}|j||�\}}||j|�fS)NzLIST ACTIVE �LIST)r�r�)r�
group_patternr��commandr�r8s      rr�z	NNTP.listtsH��	��$�$�}�4�G��G��)�)�'�4�8���e��T�_�_�U�+�+�+rc�N�tjd�}|jd|z�\}}|jd�s|jd|z�\}}i}|D]D}|j	|j��}|s�%|j
dd�\}	}
|s|
cS|
||	<�F|r||fSy)Nz^(?P<group>[^ 	]+)[ 	]+(.*)$zLIST NEWSGROUPS r(zXGTITLE rPrqrD)�re�compiler�rc�search�stripr;)rr�
return_all�line_patr�r8�groups�raw_line�matchrY�descs           r�_getdescriptionszNNTP._getdescriptions�s����:�:�>�?���)�)�*<�}�*L�M���e����u�%��-�-�j�=�.H�I�K�D�%����H��O�O�H�N�N�$4�5�E��"�[�[��A�.�
��d�!��K�#��t��
����<��rc�(�	|j|d�S)NF�r)rr;s  r�descriptionzNNTP.description�s��		7��$�$�U�E�2�2rc�(�	|j|d�S)NTr)rrs  r�descriptionszNNTP.descriptions�s��5��$�$�]�D�9�9rc�V�	|jd|z�}|jd�st|��|j�}dx}x}}t	|�}|dkDr1|d}|dkDr'|d}|dkDr|d}|dkDr|dj�}|t
|�t
|�t
|�|fS)NzGROUP r'rrPrqrrr)r�rcrr`rVrRra)rrYr��words�countr=r<�ns        rr;z
NNTP.group�s���	��~�~�h��o�.�����u�%� ��&�&��
�
��� � �� �����J���q�5��!�H�E��1�u��a����q�5� ��8�D��1�u�$�Q�x�~�~�/���S��Z��U��S��Y��<�<rc�(�	|jd|�S)N�HELP)r�)rr�s  r�helpz	NNTP.help�s��	��"�"�6�4�0�0rc��	|jd�st|��|j�}t|d�}|d}|||fS)N�22rPrq)rcrr`ra)rr�r �art_numrAs     r�
_statparsezNNTP._statparse�sL��	*����t�$� ��&�&��
�
����e�A�h�-���1�X�
��W�j�(�(rc�H�	|j|�}|j|�Sr�)r�r))rrXr�s   r�_statcmdz
NNTP._statcmd�s"��=��~�~�d�#�����t�$�$rc�j�	|r |jdj|��S|jd�S)NzSTAT {0}�STAT)r+r�)r�message_specs  r�statz	NNTP.stat�s5��	���=�=��!2�!2�<�!@�A�A��=�=��(�(rc�&�	|jd�S)N�NEXT�r+r�s r�nextz	NNTP.next����I��}�}�V�$�$rc�&�	|jd�S)N�LASTr2r�s rr<z	NNTP.last�r4rc�v�	|j||�\}}|j|�\}}}|t|||�fSr�)r�r)r?)rrXr�r�r8r(rAs       r�_artcmdzNNTP._artcmd�sB��@��m�m�D�$�/���e�$(�O�O�D�$9�!��g�z��[��*�e�<�<�<rc�T�	|�dj|�}nd}|j||�S)NzHEAD {0}�HEAD�r�r8�rr.r�rs    r�headz	NNTP.head��5��	��#��#�#�L�1�C��C��|�|�C��&�&rc�T�	|�dj|�}nd}|j||�S)NzBODY {0}�BODYr;r<s    r�bodyz	NNTP.bodyr>rc�T�	|�dj|�}nd}|j||�S)NzARTICLE {0}�ARTICLEr;r<s    r�articlezNNTP.articles5��	��#��&�&�|�4�C��C��|�|�C��&�&rc�&�	|jd�S)N�SLAVE)r�r�s r�slavez
NNTP.slave$s��	��~�~�g�&�&rc���	tjd��|jdj||�|�\}}�fd�}||D�cgc]
}||���c}fScc}w)Nz^([0-9]+) ?(.*)
?zXHDR {0} {1}c�R���j|�}|r|jdd�S|S)NrPrq)rr;)rX�m�pats  �r�
remove_numberz NNTP.xhdr.<locals>.remove_number5s'����	�	�$��A�$%�1�7�7�1�a�=�/�4�/r)rrr�r�)	r�hdrr�r�r�r8rLrXrKs	        @r�xhdrz	NNTP.xhdr*se���	��j�j�-�.���)�)�.�*?�*?��S�*I�4�P���e�	0��e�<�e�d�m�D�)�e�<�<�<��<s�Ac��	|jdj||�|�\}}|j�}|t||�fS)Nz
XOVER {0}-{1})r�r�r�ro)r�start�endr�r�r8rWs       r�xoverz
NNTP.xover:sO��	��)�)�/�*@�*@���*L�*.�0���e��"�"�$���_�U�C�0�0�0rc��	d|jvrdnd}t|ttf�r|\}}|dj	||xsd�z
}n
|�|dz|z}|j||�\}}|j
�}|t||�fS)N�OVER�XOVERz {0}-{1}rDr�)r�rF�tupler�r�r�r�ro)	rr.r�rrPrQr�r8rWs	         r�overz	NNTP.overHs���	� �$�*�*�,�f�'���l�U�D�M�2�%�J�E�3��:�$�$�U�C�I�2�6�6�C�
�
%���)�l�*�C��)�)�#�t�4���e��"�"�$���_�U�C�0�0�0rc��	|jd�}|jd�st|��|j�}t	|�dk7rt|��|d}t	|�dk7rt|��|t
|d�fS)N�DATE�111rqrP�)r�rcrr`rVrr�)rr��elemr3s    rr3z	NNTP.datecs���	�
�~�~�f�%�����u�%� ��&�&��z�z�|���t�9��>���%�%��A�w���t�9��?���%�%��_�T�4�0�0�0rc��|j|�}|jd�st|��t|tt
f�r|j
�}|D]`}|jt�s|jd�tz}|jd�rd|z}|jj|��b|jjd�|jj�|j�S)N�3r9r�s.
)r�rcrrFr7�	bytearray�
splitlines�endswithr��rstripr�r�r�r�)rr
�fr�rXs     r�_postz
NNTP._postts����~�~�g�&�����s�#� ��&�&��a�%��+�,�����A�
�D��=�=��'��{�{�7�+�e�3�����t�$��d�{���I�I�O�O�D�!��	
�	�	����!��	�	�����}�}��rc�(�	|jd|�S)N�POST)rd)r�datas  r�postz	NNTP.post�s��	1��z�z�&�$�'�'rc�F�	|jdj|�|�S)Nz	IHAVE {0})rdr�)rrArgs   r�ihavez
NNTP.ihave�s&��	O��z�z�+�,�,�Z�8�$�?�?rc���	|jr|jj�|`|jj�y#|jj�wxYwr�)r�r�r�r�s rr�zNNTP._close�s>��	��y�y��	�	���!��I��I�I�O�O���D�I�I�O�O��s�(A�A!c�v�		|jd�}|j�|S#|j�wxYw)N�QUIT)r�r�)rr�s  rr�z	NNTP.quit�s5��	1�	��>�>�&�)�D��K�K�M����
�K�K�M�s�&�8c�l�|jrtd��|s
|std��	|r=|s;ddl}|j�}|j|j�}|r
|d}|d}|sy|j
d|z�}|jd�r=|st|��|j
d|z�}|jd�st|��d|_
|j�|jr7d	|jvr(|j�d|_
|j�yyy#t
$rY��wxYw)
NzAlready logged in.z7At least one of `user` and `usenetrc` must be specifiedrrqzauthinfo user �381zauthinfo pass �281r�)r�r��netrc�authenticatorsr�r�r�rcrr	r�r�r�r�)rr�r�r�rq�credentials�authr�s        rr�z
NNTP.login�s5������1�2�2��H��I�K�
K�
		����#�k�k�m��"�1�1�$�)�)�<�����7�D�#�A�w�H����~�~�.��5�6���?�?�5�!��$�T�*�*��~�~�&6��&A�B�����u�-�,�T�2�2���
������$�$�����)C����!��D�J�� � �"�	*D�$��%�	��	�s�?D'�'	D3�2D3c��	|jd�|_y#t$rYyt$r.}|jjd�rd|_n�Yd}~yd}~wwxYw)Nzmode reader�480T)r�r�r	rrrcr�)r�es  rr�zNNTP._setreadermode�sT��
	��>�>�-�8�D�L��!�	��!�	��z�z�$�$�U�+�,0��)��*��	�s��	A�A�$A�Ac��	|jrtd��|jrtd��|jd�}|j	d�r|j
j
�t|j||j�|_|jjd�|_d|_d|_|j�ytd��)NzTLS is already enabled.z+TLS cannot be started after authentication.�STARTTLS�382r�TzTLS failed to start.)r�r�r�r�rcr�r�r�r�r�r�r�r�r)rr�r�s   r�starttlsz
NNTP.starttls�s���
�
�{�{� �!:�;�;��!�!� �!N�O�O��>�>�*�-�D����u�%��	�	���!�'��	�	�7�D�I�I�F��	� �I�I�.�.�u�5��	�"���"��
��$�$�&�� 6�7�7r)Tr�)NNT):rrrr�r��	NNTP_PORTrrr�r�r�r�r�r�r��debugr�r�r�r�r�r�r�r�r�r�r�rr	r�rrrr;r%r)r+r/r3r<r8r=rArDrGrNrRrWr3rdrhrjr�r�r�r��	_have_sslr{rrrrr+sc���H�
�F�"+�$�� �5�0�!�F #�D�	"�I���,�
�E����"� ,�\�'�(��"<��'+�,� ,0�.� 
,�t�
,��.3�:�=�4 �1�)�%�
)�%�%�=�'�d�'�'�d�'�'��'�'�&*�=� )-�1�*.�1�61�"�*(�@���'#�R��	8�rrc�8��eZdZedddddef�fd�	Z�fd�Z�xZS)�NNTP_SSLNFc		�@��	||_t�	|�	|||||||�yr�)�ssl_context�superr)
rr�r�r�r�r�r�r�r�rs
         �rrzNNTP_SSL.__init__�s.���
� +�D���G��T�4��x��%�w�
0rc���t�|�|�}	t||j|j�}|S#|j��xYwr�)r�r�r�r�r�r�)rr�r�rs   �rr�zNNTP_SSL._create_socketsI����7�)�'�2�D�
�"�4��)9�)9�4�9�9�E��
���	
��
�
���s	�!5�A)rrr�
NNTP_SSL_PORTrrr��
__classcell__)rs@rr�r��s$���&3���$�#�e�3�		0�	�	rr��__main__zJ        nntplib built-in demo - display the latest articles in a newsgroup)rz-gz--groupzgmane.comp.python.generalz3group to fetch messages from (default: %(default)s))�defaultr%z-sz--serverz
news.gmane.ioz+NNTP server hostname (default: %(default)s)z-pz--portr�zNNTP port number (default: z / �))r��typer%z-nz
--nb-articles�
z2number of articles to fetch (default: %(default)s)z-Sz--ssl�
store_truezuse NNTP over SSL)�actionr�r%)r�r�ry�Group�haszarticles, range�toc�8�t|�|kDr|d|dz
dz}|S)Nrrz...)rV)�s�lims  r�cutr�6s&���q�6�C�<��(�3��7��e�#�A��rrPr2�<r1z{:7} {:20} {:42} ({})��*r�)F)Jrr��collectionsrwr��warningsr�r~�ImportError�email.headerrrEr�__all__�_deprecatedrr�rrrrr	r
rr|r�r�rUrSr��
namedtupler:r?r]ror�r�r�rr�rG�argparse�ArgumentParser�parser�add_argumentra�
parse_argsrr��serverr�r�r�r{r;r�r!r=r<rYr�r�r��nb_articlesrR�	overviews�artnumrWr`�authorr1r8r�r�rrr�<module>r�s����B
�
���
�����I�>�*�
������X�g�.���0�	�0�	�Y�	�	��	�	��	�	�	�	�	�I�	�
�	��
�

�	� O��
�
���	��"�K�"�"�;�#E�
G�	�%�k�$�$�]�%F�H��
	��2�:H�,�4
�
C�K8�K8�\
��4��.�N�N�:���z���
$�X�
$�
$�2N�O�F�
����i�1L�R��T�
����j�/�J��L�
����h���FO�Q^�_��a�
����o�r��Q��S�
����g�l�E�0��2�����D��9�9�D��8�8��2�:��D��d�k�k��-���2�:� �D��$�+�+�D�1������D��T��	�
�
��%&�W�W�T�Z�Z�%8�"�D�%���d�	�'�4���'8�%��t�L��

��D�	�D�,�,�,�q�0�1�E��g�g�e�T�*�O�D�)�!�����t�F�|�,�2�2�3��:�1�=����Y��0���D��N�#��
�%�,�,��c�&�"�o�s�7�B�'7��@�	�	"��F�F�H�a��U���I��s�K6�6L�L

?>