Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
ï»¿Ë â{|j ã ó —dZddlZddlZddlZddlZddlZddlZ ddlZdZddl m Z ddlm Z gd¢Zejed¬ «d ZGd „d e«ZGd „de«ZGd„de«ZGd„de«ZGd„de«ZGd„de«ZdZdZhd£Zgd¢ZdddœZdZej>dgd ¢«Z ej>d!gd"¢«Z!d#„Z d$„Z"dWd%„Z#dWd&„Z$dXd'„Z%erd(„Z&Gd)„d*«Z'erGd+„d,e'«Z(ejSd,«ed-k(�rêddl*Z*e*jVd.¬/«Z,e,j[d0d1d2d3¬4«e,j[d5d6d7d8¬4«e,j[d9d:d;e.d�¬?«e,j[d@dAdBe.dC¬?«e,j[dDdEdFddG¬H«e,j_«Z0e0jbZ1e0jse1d;k(reZ1e'e0jde1¬I«Z3ne1d;k(reZ1e(e0jde1¬I«Z3e3ji«Z5dJe5vre3jm«e3joe0jn«\Z8Z9Z:Z;Z<e=dKee?e.e;«e0j€z dPz«Z:e3jƒe:e;«\Z8ZBeBD]a\ZCZDe eDdQ«j‹dRdP«dZFe eDdS«ZGe.eDd«ZHe=dTj“eCe>eFdU«e>eGdV«eH««Œce3j•«yy#e $rdZY�ŒßwxYw)Ya±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. éNTF)Ú decode_header)Ú_GLOBAL_DEFAULT_TIMEOUT)ÚNNTPÚ NNTPErrorÚNNTPReplyErrorÚNNTPTemporaryErrorÚNNTPPermanentErrorÚNNTPProtocolErrorÚ NNTPDataErrorr)éé )Úremoveicó—eZdZdZd„Zy)rz%Base class for all nntplib exceptionscór—tj|g|¢­Ž |d|_y#t$r d|_YywxYw)NrzNo response given)Ú ExceptionÚ__init__ÚresponseÚ IndexError)ÚselfÚargss ú /usr/lib64/python3.12/nntplib.pyrzNNTPError.__init__es;€Ü×ј4Ð' $Ó'ð 0Ø  ™GˆD�MøÜò 0Ø/ˆDŽMð 0ús ˜ #£6µ6N)Ú__name__Ú __module__Ú __qualname__Ú__doc__r©órrrcs „Ù/ó0rrcó—eZdZdZy)rzUnexpected [123]xx replyN©rrrrrrrrrls„Ù"Ørrcó—eZdZdZy)rz 4xx errorsNrrrrrrpó„ÙØrrcó—eZdZdZy)r z 5xx errorsNrrrrr r tr!rr có—eZdZdZy)r z"Response does not begin with [1-5]Nrrrrr r xs„Ù,Ørr có—eZdZdZy)r zError in response dataNrrrrr r |s„Ù Ørr éwi3> Ú100Ú101Ú211Ú215Ú220Ú221Ú222Ú224Ú225Ú230Ú231Ú282)ÚsubjectÚfromÚdatez message-idÚ referencesú:bytesú:linesr6r7)ÚbytesÚlinesó Ú GroupInfo)ÚgroupÚlastÚfirstÚflagÚ ArticleInfo)ÚnumberÚ message_idr9cóÚ—g}t|«D]K\}}t|t«r%|j|j |xsd««Œ;|j|«ŒMdj |«S)zvTakes a unicode string representing a munged header value and decodes it as a (possibly non-ASCII) readable value.ÚasciiÚ)Ú_email_decode_headerÚ isinstancer8ÚappendÚdecodeÚjoin)Ú header_strÚpartsÚvÚencs rrrªsZ€ð €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 |«kr td«‚|dt |«|k7r td«‚|S)zÐParse a list of string representing the response to LIST OVERVIEW.FMT and return a list of header/metadata names. Raises NNTPDataError if the response is not compliant (cf. RFC 3977, section 8.4).rÚ:éNz$LIST OVERVIEW.FMT response too shortz*LIST OVERVIEW.FMT redefines default fields)Ú partitionÚlowerÚ_OVERVIEW_FMT_ALTERNATIVESÚgetrHÚ_DEFAULT_OVERVIEW_FMTÚlenr )r9Ú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Œ|| } | j d«} | |k\rE| sC| dz} | r*| dt| «j «| k7r td«‚| r| t| «dnd} | ||| <Œ~|j||f«ŒÁ|S)zZParse the response to an OVER or XOVER command according to the overview format `fmt`.Ú rPz: Nz?OVER/XOVER response doesn't include names of additional headers) rWrVÚsplitÚintÚ enumerateÚ startswithrSr rH)r9rXÚdata_process_funcÚ n_defaultsÚoverviewrYÚfieldsÚarticle_numberÚtokensÚiÚtokenÚ field_nameÚ is_metadataÚhs rÚ_parse_overviewrpÎ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 |d kr|d z }tj||||||«S) zÈParse a pair of (date, time) strings, and return a datetime object. If only the date is given, it is assumed to be date and time concatenated together (e.g. response to the DATE command). NiúÿÿÿéééüÿÿÿéþÿÿÿéFiÐédil)rbÚ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)aPFormat a date or datetime object as a pair of (date, time) strings in the format required by the NEWNEWS and NEWGROUPS commands. If a date object is passed, the time is assumed to be midnight (00h00). The returned representation depends on the legacy flag: * if legacy is False (the default): date has the YYYYMMDD format and time the HHMMSS format * if legacy is True: date has the YYMMDD format and time the HHMMSS format. RFC 3977 compliant servers should understand both formats; therefore, legacy is only needed when talking to old servers. Ú000000z({0.hour:02d}{0.minute:02d}{0.second:02d}rwz{0:02d}{1.month:02d}{1.day:02d}z{0:04d}{1.month:02d}{1.day:02d})rGrxÚformatr~)ÚdtÚlegacyrzÚyrys rÚ_unparse_datetimerˆs|€ô �bœ(×+Ñ+Ô ,؉à=×DÑDÀRÓHˆØ �‰€AÙ Ø �‰GˆØ4×;Ñ;¸A¸rÓBˆð �XÐ Ðð5×;Ñ;¸A¸rÓBˆØ �XÐ ÐrcóT—|€tj«}|j||¬«S)zÇWrap a socket in SSL/TLS. Arguments: - sock: Socket to wrap - context: SSL context to use for the encrypted connection Returns: - sock: New, encrypted socket. )Úserver_hostname)ÚsslÚ_create_stdlib_contextÚ wrap_socket)ÚsockÚcontextÚhostnames rÚ _encrypt_onr‘s-€ð ˆ?Ü×0Ñ0Ó2ˆGØ×"Ñ" 4¸Ð"ÓBÐBrcó¦—eZdZdZdZeddddefd„Zd„Zd„Z d„Z d „Z d „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óz—||_||_|j|«|_d|_ |jj d«|_|j |«|s|r|j|||«yy#|jr|jj«|jj«‚xYw)a,Initialize an instance. Arguments: - host: hostname to connect to - port: port to connect to (default the standard NNTP port) - user: username to authenticate with - password: password to use with username - readermode: if true, send 'mode reader' command after connecting. - usenetrc: allow loading username and password from ~/.netrc file if not specified explicitly - timeout: timeout (in seconds) used for socket connections readermode is sometimes necessary if you are connecting to an NNTP server on the local machine and intend to call reader-specific commands, such as `group'. If you get unexpected NNTPPermanentErrors, you might need to set readermode. 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 ­AA7Á7AB:có—d|_|j«|_d|_|j «d|_|rAd|jvr3|j «|j sd|_|j «d|_d|_y)z~Partial initialization for the NNTP protocol. This instance method is extracted for supporting the test code. rNFÚ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ÚzNNTP.__exit__..„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óЗ|� |s td«‚tjd||j|j«t j |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óp—|jrtdt|j««|jS)zÅGet the welcome message from the server (this is read and squirreled away by __init__()). If the response code is 200, posting is allowed; if it 201, posting is not allowed.z *welcome*)r¥ÚprintÚreprr§r°s rÚ getwelcomezNNTP.getwelcome”s'€ð �>Š>œ5 ¬d°4·<±<Ó.@ÔAØ�|‰|Ðrcón—|j€wd|_d|_ |j«\}}||_d|vr!t t t |d««|_d|vrdj|d«|_|jS|jS#ttf$ri|_Y|jSwxYw)zŒGet the server capabilities, as read by __init__(). If the CAPABILITIES command is not supported, an empty dict is returned.NrQÚVERSIONÚIMPLEMENTATIONÚ ) r¨Ú nntp_versionÚnntp_implementationÚ capabilitiesÚmaxÚmaprbrJr 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ÂB4Â3B4có—||_y)zÞSet the debugging level. Argument 'level' means: 0: no debugging output (default) 1: print commands and responses but not body text etc. 2: also print raw lines read and sent before stripping CR/LFN)r¥)rÚlevels rÚset_debuglevelzNNTP.set_debuglevel³s €ð ˆ�rcóö—tjd||«|tz}|jdkDrt dt |««|j j|«|j j«y)zfInternal: send one line to the server, appending CRLF. The `line` must be a bytes-like object.znntplib.putlinerQz*put*N) r¾r¿Ú_CRLFr¥rÃrÄr™ÚwriteÚflush©rrYs rÚ_putlinez NNTP._putline¼sU€ô � ‰ Ð# T¨4Ô0Ø”e‰|ˆØ �>‰>˜AÒ œu W¬d°4«jÔ9Ø � ‰ �‰˜ÔØ � ‰ �‰Õrcó´—|jrtdt|««|j|j|j «}|j |«y)zkInternal: send one command to the server (through _putline()). The `line` must be a unicode string.z*cmd*N)r¥rÃrÄÚencodeÚencodingÚerrorsrÙrØs rÚ_putcmdz NNTP._putcmdÅs<€ð �>Š>œ5 ¬$¨t«*Ô5Ø�{‰{˜4Ÿ=™=¨$¯+©+Ó6ˆØ � ‰ �dÕrcó&—|jjtdz«}t|«tkDr t d«‚|j dkDrt dt|««|st‚|r#|ddtk(r|dd}|S|ddtvr|dd}|S)z�Internal: return one line from the server, stripping _CRLF. Raise EOFError if the connection is closed. Returns a bytes object.rQz line too longz*get*ruNéÿÿÿÿ) r™ÚreadlineÚ_MAXLINErWr r¥rÃrÄr¸rÕ)rÚ strip_crlfrYs 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(r t|«‚|dk(r t|«‚|dvr t|«‚|S)zŒInternal: get a response from the server. Raise various errors if the response indicates an error. Returns a unicode string.z*resp*NrQÚ4Ú5Ú123) rär¥rÃrÄrIrÜ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 vr t |«‚g}|�Jdtzdf} |jd«}||vrni|jd«r|dd}|j|«Œ>d} |j«}||k(rn(|jd«r|dd}|j|«Œ>|r|j«||fS#|r|j«wwxYw) aPInternal: get a response plus following text from the server. Raise various errors if the response indicates an error. Returns a (response, lines) tuple where `response` is a unicode string and `lines` is a list of bytes objects. If `file` is a file-like object, it must be open in binary mode. NÚwbr ó.s. rQFs..) rGÚstrr8Úopenr¦Ú _LONGRESPrrÕrärdrÖrHr�)rr™Ú openedFilerÏr9Ú terminatorsrYÚ 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 „CC3Ã3DcóD—|j|«|j«S)zWInternal: send a command and get the response. Same return value as _getresp().)rÞr¦rØs rÚ _shortcmdzNNTP._shortcmds€ð � ‰ �TÔØ�}‰}‹ÐrcóF—|j|«|j|«S)zoInternal: send a command and get the response plus following text. Same return value as _getlongresp().)rÞró)rrYr™s rÚ_longcmdz NNTP._longcmd!s!€ð � ‰ �TÔØ× Ñ  Ó&Ð&rcó—|j|«|j|«\}}||D�cgc](}|j|j|j«‘Œ*c}fScc}w)zÒInternal: send a command and get the response plus following text. Same as _longcmd() and _getlongresp(), except that the returned `lines` are unicode strings rather than bytes objects. )rÞrórIrÜrÝ)rrYr™rÏÚlists rÚ_longcmdstringzNNTP._longcmdstring'sd€ð � ‰ �TÔØ×&Ñ& tÓ,‰ ˆˆdØÙ"&ó(Ù"&˜$ð—k‘k $§-¡-°·±Õ=Ø"&ñ(ð(ð (ùò(s«-Acó¾— |jS#t$rYnwxYw |jd«\}}t|«}n#t$r t dd}YnwxYw||_|S)zqInternal: get the overview format. Queries the server if not already done, else returns the cached value.zLIST OVERVIEW.FMTN)Ú_cachedoverviewfmtÚAttributeErrorrúr^r rV)rrÏr9rXs rÚ_getoverviewfmtzNNTP._getoverviewfmt1su€ð Ø×*Ñ*Ð *øÜò Ù ð úð -Ø×-Ñ-Ð.AÓB‰KˆD�%ô & eÓ,‰Cøô "ò +ä'©Ð*ŠCð +úð #&ˆÔ؈ s‚ Ž ™ž>¾AÁAcóT—|D�cgc]}t|j«Ž‘Œc}Scc}wr¯)r;ra)rr9rYs rÚ _grouplistzNNTP._grouplistBs%€á5:Ó;±U¨T” ˜4Ÿ:™:›<Ò(°UÑ;Ð;ùÒ;s…%cór—i}|jd«\}}|D]}|j«^}}|||<Œ||fS)a!Process a CAPABILITIES command. Not supported by all servers. Return: - resp: server response if successful - caps: a dictionary mapping capability names to lists of tokens (for example {'VERSION': ['2'], 'OVER': [], LIST: ['ACTIVE', 'HEADERS'] }) Ú CAPABILITIES)rúra)rrÐrÏr9rYrZrjs rrÌzNNTP.capabilitiesFsK€ðˆØ×)Ñ)¨.Ó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)zÁProcess a NEWGROUPS command. Arguments: - date: a date or datetime object Return: - resp: server response if successful - list: list of newsgroup names úAthe date parameter must be a date or datetime object, not '{:40}'rrzNEWGROUPS {0} {1}) rGrxr4Ú TypeErrorr„Ú __class__rrˆrÊrúr)rr4r™ryrzÚcmdrÏr9s rÚ newgroupszNNTP.newgroupsTs›€ô˜$¤§¡´· ± Ð >Ô?Üðß$™f T§^¡^×%<Ñ%<Ó=ó?ð ?ô/¨t°T×5FÑ5FÈÑ5JÓKш�(Ø!×(Ñ(¨°8Ó<ˆØ×)Ñ)¨#¨tÓ4‰ ˆˆeØ�T—_‘_ UÓ+Ð+Ð+rcó4—t|tjtjf«s.tdj |j j ««‚t||jdk«\}}dj |||«}|j||«S)zÞProcess a NEWNEWS command. Arguments: - group: group name or '*' - date: a date or datetime object Return: - resp: server response if successful - list: list of message ids rrrzNEWNEWS {0} {1} {2}) rGrxr4rr„rrrˆrÊrú)rr<r4r™ryrzrs rÚnewnewsz NNTP.newnewsds†€ô˜$¤§¡´· ± Ð >Ô?Üðß$™f T§^¡^×%<Ñ%<Ó=ó?ð ?ô/¨t°T×5FÑ5FÈÑ5JÓKш�(Ø#×*Ñ*¨5°(¸HÓEˆØ×"Ñ" 3¨Ó-Ð-rcóf—|�d|z}nd}|j||«\}}||j|«fS)a@Process a LIST or LIST ACTIVE command. Arguments: - group_pattern: a pattern indicating which groups to query - file: Filename string or file object to store the result in Returns: - resp: server response if successful - list: list of (group, last, first, flag) (strings) z LIST ACTIVE ÚLIST)rúr)rÚ group_patternr™ÚcommandrÏr9s rrùz NNTP.listtsC€ð Ð $Ø$ }Ñ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[^ ]+)[ ]+(.*)$zLIST NEWSGROUPS r)zXGTITLE rQrrrE)ÚreÚcompilerúrdÚsearchÚstripr<) rr Ú return_allÚline_patrÏr9ÚgroupsÚraw_lineÚmatchrZÚ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)aéGet a description for a single group. If more than one group matches ('group' is a pattern), return the first. If no group matches, return an empty string. This elides the response code from the server, since it can only be '215' or '285' (for xgtitle) anyway. If the response code is needed, use the 'descriptions' method. NOTE: This neither checks for a wildcard in 'group' nor does it check whether the group actually exists.F©r)rr<s rÚ descriptionzNNTP.descriptionšs€ð×$Ñ$ U¨EÓ2Ð2rcó&—|j|d«S)z'Get descriptions for a range of groups.Tr)rr s rÚ descriptionszNNTP.descriptions§s€à×$Ñ$ ]°DÓ9Ð9rcóT—|jd|z«}|jd«s t|«‚|j«}dx}x}}t |«}|dkDr1|d}|dkDr'|d}|dkDr|d}|dkDr|dj «}|t |«t |«t |«|fS)aProcess a GROUP command. Argument: - group: the group name Returns: - resp: server response if successful - count: number of articles - first: first article number - last: last article number - name: the group name zGROUP r(rrQrrr rs)rõrdrrarWrSrb)rrZrÏÚ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¸Ð<Ð.remove_number5s'ø€Ø— ‘ ˜$“ˆAÙ$%�1—7‘7˜1˜a“=Ð /¨4Ð /r)rrrúr„) rÚhdrrír™rÏr9rMrYrLs @rÚxhdrz NNTP.xhdr*s`ø€ô�j‰jÐ-Ó.ˆØ×)Ñ)¨.×*?Ñ*?ÀÀSÓ*IÈ4ÓP‰ ˆˆeô 0ð±eÓ<±e¨d‘m DÕ)°eÑ<Ð<Ð<ùÒÜ Ó%Ð %Ø�A‰wˆÜ ˆt‹9˜Š?Ü Ó%Ð %Ø”_ T¨4Ó0Ð0Ð0rcóü—|j|«}|jd«s t|«‚t|tt f«r|j «}|D]`}|jt«s|jd«tz}|jd«rd|z}|jj|«Œb|jjd«|jj«|j«S)NÚ3r:rìs. )rõrdrrGr8Ú bytearrayÚ splitlinesÚendswithrÕÚrstripr™rÖr×r¦)rrÚfrÏrYs rÚ_postz NNTP._postts½€Ø�~‰~˜gÓ&ˆà�‰˜sÔ#Ü  Ó&Ð &Ü �aœ%¤Ð+Ô ,Ø— ‘ “ˆAó ˆDØ—=‘=¤Ô'Ø—{‘{ 7Ó+¬eÑ3�Ø�‰˜tÔ$ؘd‘{�Ø �I‰I�O‰O˜DÕ !ð ð � ‰ �‰˜Ô!Ø � ‰ �‰ÔØ�}‰}‹Ðrcó&—|jd|«S)z¨Process a POST command. Arguments: - data: bytes object, iterable or file containing the article Returns: - resp: server response if successfulÚPOST)re)rÚdatas rÚpostz NNTP.post‰s€ð �z‰z˜& $Ó'Ð'rcóD—|jdj|«|«S)a Process an IHAVE command. Arguments: - message_id: message-id of the article - data: file containing the article Returns: - resp: server response if successful Note that if the server refuses the article an exception is raised.z IHAVE {0})rer„)rrBrhs rÚihavez NNTP.ihave�s €ð�z‰z˜+×,Ñ,¨ZÓ8¸$Ó?Ð?rcóÈ— |jr|jj«|`|jj«y#|jj«wxYwr¯)r™r�rŽr°s rr¹z NNTP._close™s>€ð Ø�yŠyØ— ‘ —‘Ô!Ø�Ià �I‰I�O‰OÕ øˆD�I‰I�O‰OÕ ús ‚(AÁA!cót— |jd«}|j«|S#|j«wxYw)zdProcess a QUIT command and close the socket. Returns: - resp: server response if successfulÚQUIT)rõr¹)rrÏs rr¶z NNTP.quit¡s0€ð Ø—>‘> &Ó)ˆDà �K‰KŒM؈ øð �K‰K�Mús‚%¥7cól—|jr td«‚|s |s td«‚ |r=|s;ddl}|j«}|j|j«}|r |d}|d}|sy|j d|z«}|jd«r=|s t|«‚|j d|z«}|jd«s t|«‚d|_ |j«|jr7d |jvr(|j«d|_ |j«yyy#t $rYŒËwxYw) NzAlready logged in.z7At least one of `user` and `usenetrc` must be specifiedrrrzauthinfo user Ú381zauthinfo pass Ú281r¤)r­r½ÚnetrcÚauthenticatorsr–r·rõrdrr r¨r©rªr«)rržrŸr¡rrÚ 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.}|jj d«rd|_n‚Yd}~yd}~wwxYw)Nz mode readerÚ480T)rõr§r rrrdrª)rÚes rr«zNNTP._setreadermodeÓsT€ð ØŸ>™>¨-Ó8ˆD�LøÜ!ò á Ü!ò Ø�z‰z×$Ñ$ UÔ+à,0�Õ)àô*ûð ús‚™ A¤A¬$AÁAcó¶—|jr td«‚|jr td«‚|jd«}|j d«r|j j «t|j||j«|_|jjd«|_d|_d|_ |j«ytd«‚) zzProcess a STARTTLS command. Arguments: - context: SSL context to use for the encrypted connection zTLS is already enabled.z+TLS cannot be started after authentication.ÚSTARTTLSÚ382r•TNzTLS failed to start.)r¬r½r­rõrdr™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þrrÌrr rùrrrr<r&r*r,r0r4r=r9r>rBrErHrOrSrXr4rerirkr¹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‰ |� |||||||«y)z›This works identically to NNTP.__init__, except for the change in default port and the `ssl_context` argument for SSL connections. N)Ú 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—rzÚGroupÚhaszarticles, rangeÚtocó8—t|«|kDr |d|dz dz}|S)Nrsz...)rW)ÚsÚlims rÚcutr•6s&€Ü ˆq‹6�CŠ<Ø�(�3˜‘7� ˜eÑ#ˆA؈rrQr3Úr=rZrÃr•ríÚ nb_articlesrSÚ overviewsÚartnumrXraÚauthorr2r9r„r¶rrrÚrªs˜ðñóB Û ÛÛÛ ÛðÛð€Iå>Ý*ò €ð €×Ñ�X gÕ.ð €ô0� ô0ô �Yô ô ˜ô ô ˜ô ô ˜ ô ô �Iô ð € Ø€ ò € ò OÐð Ø ñÐð €à "ˆK× "Ñ " ;Ú#Eó G€ ð%ˆk×$Ñ$ ]Ú%FóH€ ò òó2ó:Hó,ñ4 ò C÷K 8ñK 8ñ\ ô�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œK7Ë7LÌL