✏️ 编辑:nntplib.cpython-39.opt-1.pyc
路径:
/usr/lib64/python3.9/__pycache__/nntplib.cpython-39.opt-1.pyc
大小:31 KB · 修改:2026-08-12 15:51:23 · 权限:0644 · 只读(保存会失败)
← 返回目录
👁 查看
⬇ 下载
检测到二进制内容,直接保存可能损坏文件。请改用「上传替换」。
a �i?� � @ s> d Z ddlZddlZddlZddlZddlZzddlZW n eyN dZY n0 dZddl m Z ddlmZ g d�Z dZG d d � d e�ZG dd� de�ZG d d� de�ZG dd� de�ZG dd� de�ZG dd� de�ZdZdZh d�Zg d�Zddd�ZdZe�dg d��Ze�dg d ��Zd!d"� Z d#d$� ZdZd%d&�Z d[d'd(�Z!d\d)d*�Z"e�rZd+d,� Z#G d-d.� d.�Z$e�r�G d/d0� d0e$�Z%e �&d0� e'd1k�r:ddl(Z(e(j)d2d3�Z*e*j+d4d5d6d7d8� e*j+d9d:d;d<d8� e*j+d=d>d?e,d@eef dA� e*j+dBdCdDe,dEdA� e*j+dFdGdHddIdJ� e*�-� Z.e.j/Z/e.j�sBe/d?k�r2eZ/e$e.j0e/dK�Z1ne/d?k�rPeZ/e%e.j0e/dK�Z1e1�2� Z3dLe3v �rxe1�4� e1�5e.j5�\Z6Z7Z8Z9Z:e;dMe:dNe7dOe8dPe9� dQdR� Z<e=e,e9�e.j> dS �Z8e1�?e8e9�\Z6Z@e@D ]Z\ZAZBe eBdT ��CdUdS�d ZDe eBdV �ZEe,eBd �ZFe;dW�GeAe<eDdX�e<eEdY�eF�� �q�e1�H� dS )]a� An NNTP client class based on: - RFC 977: Network News Transfer Protocol - RFC 2980: Common NNTP Extensions - RFC 3977: Network News Transfer Protocol (version 2) Example: >>> from nntplib import NNTP >>> s = NNTP('news') >>> resp, count, first, last, name = s.group('comp.lang.python') >>> print('Group', name, 'has', count, 'articles, range', first, 'to', last) Group comp.lang.python has 51 articles, range 5770 to 5821 >>> resp, subs = s.xhdr('subject', '{0}-{1}'.format(first, last)) >>> resp = s.quit() >>> Here 'resp' is the server response line. Error responses are turned into exceptions. To post an article from a file: >>> f = open(filename, 'rb') # file containing article, including header >>> resp = s.post(f) >>> For descriptions of all methods, read the comments in the code below. Note that all arguments and return values representing article numbers are strings, not numbers, since they are rarely used for calculations. � NFT)� decode_header)�_GLOBAL_DEFAULT_TIMEOUT)�NNTP� NNTPError�NNTPReplyError�NNTPTemporaryError�NNTPPermanentError�NNTPProtocolError� NNTPDataErrorr i c @ s e Zd ZdZdd� ZdS )r z%Base class for all nntplib exceptionsc G s>