%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/mailman/Mailman/Archiver/
Upload File :
Create Path :
Current File : //lib/mailman/Mailman/Archiver/HyperArch.pyo

�
��ac@sydZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlmZmZddlmZddlmZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddl m!Z!ej"Z"e#Z$ej%r�yddl$Z$Wne&k
r�nXndZ'dZ(ej)dkr.yddl*Z*Wne&k
r�nNXe*j+e*j,�\Z-Z.e/e.e0e-dd��Z1e*j2e*j,e1e.f�nye3e4fWne5k
r[dZ3dZ4nXe#d�Z6d�Z7d�Z8d�Z9dZ:e#d�Z;ej<d�Z=ej<dej>�Z?ej<d�Z@ej<d ej>�ZAej<d!�ZBej<d"ej>�ZCej<d#ej>�ZDej<d$�ZEiZFiZGe#e#e#d%�ZHd&ejIfd'��YZId(ejJfd)��YZKdS(*slHyperArch: Pipermail archiving for Mailman

     - The Dragon De Monsyne <dragondm@integral.org>

   TODO:
     - Should be able to force all HTML to be regenerated next time the
       archive is run, in case a template is changed.
     - Run a command to generate tarball of html archives for downloading
       (probably in the 'update_dirty_archives' method).
i����(t
nested_scopesN(t
decode_headertmake_header(tHeaderParseError(tCharset(tmm_cfg(tUtils(tErrors(tLockFile(tMailList(ti18n(tSafeDict(tsyslog(tArchiverMailboxts
tdarwiniiiicCsKd	d
ddf}x&|D]\}}|j||�}qWtj||�S(
Nt&s&amp;t<s&lt;t>s&gt;t"s&quot;(Rs&amp;(Rs&lt;(Rs&gt;(Rs&quot;(treplaceRt
uncanonstr(tstlangtreplstthingtrepl((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyt
html_quotebs	cCs
tj|�S(N(turllibtquote(R((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyt	url_quotelscCs|jdd�S(Ntt (R(R((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyt
null_to_spacepscCs�ytjj|�}Wn2tk
rJ}|jtjkr@�ntd�SX|dkr�tj�}ztj	|�td�}Wdtj
|�X|S|dkr�d|dSd|dS(Nssize not availablei�s %(size)i bytes i@Bs %d KB s %d MB (tostpathtgetsizetOSErrorterrnotENOENTt_R
tget_translationtset_languagetset_translation(tfilenameRtsizetetotranstout((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytsizeofts 
s@<META http-equiv="Content-Type" content="text/html; charset=%s">cCsUt|tj�r$tj|�}ntjt|��}tj|jdd�|�S(NRs&quot;(t
isinstancettypestUnicodeTypeRtwebsafetstrRR(targRR((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyt	CGIescape�ss
([(].*[)])s\s*RE\s*(\[\d+\]\s*)?:\s*s([-+,.\w]+@[-+.\w]+)s&([a-z]+://.*?)(?:_\s|_$|$|[]})>\'"\s])s^\s*$s^\s*<HTML>\s*$s^\s*</HTML>\s*$s^([>|:]|&gt;)+c	Csz|dkrd}n	|j}|dkrN|dkrBtj}qN|j}n|||f}tj|�}|r�tj|�}n|dks�|dkr�tj	|d|dt
d|�\}}|t|<|t|<n|}|dk	rjyat|�}	y|	j|�}Wn;t
k
rKt|tj|�d�}
|	j|
�}nXWqjttfk
rfqjXntj||�S(NRRtrawtmlistR(tNonet_internal_nameRtDEFAULT_SERVER_LANGUAGEtpreferred_languaget_templatefilepathcachetgett_templatecacheRtfindtexttTrueRtinterpolatetUnicodeErrortunicodet
GetCharSett	TypeErrort
ValueErrorR(ttemplatefiletdictRR:tlistnametcachekeytfilepathttemplatettexttsdictt	utemplate((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytquick_maketext�s<		


	tArticlecBseZejjZejjZej�Z	ddgejdd�Ze
j�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd	�Zd
�Zd�Zd�Zd
�Zejd�Zejd�Zd�Z d�Z!d�Z"d�Zd�Z#d�Z$RS(ic
Cs	|j|||�d|_d|_d}xP|dkr}tj|j�}|rt|jd�}|j||_q.d}q.W||_||_	t
jr(tj
�}zotj|�|j|jkr�tjdtd�|j�|_|_n!tjdtd�|j�|_Wdtj|�Xn|jdd�}	|jdd�}
|	j�|_|
j�|_i|_tj|j�}t|�jp�|}t|t �r�|j!d	�}n|j"|�}
|
r�|
j�j#�}
|
dd
kr|
dd
kr|
dd!}
n|
ddkrB|
ddkrB|
dd!}
ny|j$d
t%�}Wnt&j'k
rtd}nX|r�|
tj|j�kr�yt ||
�}Wq�t(t)fk
r�d}q�Xn|r�g|j*�D]}|d^q�|_+q�n|j,�dS(Nii����t@s at sContent-Types
text/plainsContent-Transfer-EncodingRsus-asciiRit'tdecodes
(-t_Article__super_initR;tprevtnexttREpattmatchtsubjecttendt_langt_mlistRtARCHIVER_OBSCURES_EMAILADDRSR
R)R*tauthortemailtretsubR(R+R@tlowertctypetcenctdecodedRRGR>Rtoutput_charsetR2RFtencodetget_content_charsettstriptget_payloadRCtbinasciitErrorREtLookupErrort
splitlinestbodytdecode_headers(tselftmessagetsequencetkeepHeadersRR:titresultR/RgRhtcsettcset_outtcharsetRstl((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyt__init__sb		
			
%	  

,cCsr|jj|�}|snytj|dd�}Wn*tjk
r]}tdd||�dSX||j|<n|S(Ntlockiterrorserror opening list: %s
%s(t
_listcacheR@R	RtMMListErrorRR;(RuRLR:R.((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyt
_open_listSscCs�|jj�}|jd�r2|d}|d=nd}|rT|jj�|d<n
d|d<x'dD]}|j|�re||=qeqeWg|d<|S(NR`t
__listnameRYRZRs(sprevsnextsbody(t__dict__tcopythas_keyR;R`t
internal_name(RutdR:tattr((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyt__getstate__bs




cCs�||_|jd�}|r;|d=|j|�|d<n|jd�szt|d�rk|jj|_qztj	|_n|jd�s�d|_n|jd�s�i|_ndS(NR�R`R_RhRi(
R�R@R�R�thasattrR`R>R_RR=R;RhRi(RuR�RL((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyt__setstate__vs	cCs(t|dd�dkr$||_ndS(NR`(tgetattrR;R`(RuR:((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytsetListIfUnset�scCst||j�S(N(RR_(Rutbuf((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyR�scCs|j|j�}|j|j�}|rb||jd<|j|j�}|rb||jd<qbn|r�tjr�tj�}zRtj	|j
�ttd�t
j|j
��}tjdd|d|�}Wdtj|�Xn||jd<n|j|p|j�|jd	<dS(
s�MIME-decode headers.

        If the email, subject, or author attributes contain non-ASCII
        characters using the encoded-word syntax of RFC 2047, decoded versions
        of those attributes are placed in the self.decoded (a dictionary).

        If the list's charset differs from the header charset, an attempt is
        made to decode the headers as Unicode.  If that fails, they are left
        undecoded.
        RbRcs at s([-+,.\w]+)@([-+.\w]+)s\g<1>s\g<2>NR]tstripped(tdecode_charsetRbR]RiRcRRaR
R)R*R_RFR(RRGRdReR+t
strip_subject(RuRbR]RcR/tatmark((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyRt�s$
	!	cCs�|jjj�}|rltj|�}dj|jd��}tjdd|�}tj|d|�}n|j�}tj	dtj
�}|jd|�}tjdd|�}|S(Nt%s\%s%\d*ds	\s*\d+\s*Rs^((RE|AW|SV|VS)(\[\d+\])?:\s*)+s\s(R`tsubject_prefixRmRdtescapetjointsplitRetlstriptcompiletI(RuR]tprefixt
prefix_patt	strip_patR�((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyR��scCs�y"t|�}t|�j�}WnYttttfk
r}tj|j	j
�}|dkrhd}nt||d�}nXdj|j
��S(Nsus-asciis
iso-8859-1Ru(RRt__unicode__RqRERIRRRGR`R>RFR�Rr(RutfieldtpairstustrR{((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyR��s	cCs|jj�}tj�}tj|j�z}|j�\|d<|d<|j�\|d<|d<|j|j	�|d<|j|j
�|d<|j|j
�|d<td|j
�|d	<t|j�|d
<t
jrtjdtd�|j�}|jj�}n|j}|j	}|j|�|d
<t|�|d<|jtjt|j���|d<|j�|d<|jjddd�|d<|jj|d<d|d<Wdtj|�Xtj|j�}t||d<|j|�t d|d|jd|j�S(NRYt
prev_wsubjRZt
next_wsubjt
email_htmlttitletsubject_htmlsRe: tsubject_urltin_reply_to_urlRUs at tauthor_htmlt	email_urltdatestr_htmlRstlistinfotabsoluteitlisturlRLRtencodingsarticle.htmlRR:(!R�R�R
R)R*R_t	_get_prevt	_get_nextRRcR]Rt_message_idRRaRdReR(RbR`tGetListEmailtctimetinttdatet	_get_bodytGetScriptURLt	real_nameR+RRGthtml_charsett_add_decodedRS(RuR�R/RbtemailurlR}((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytas_html�s<			%
	cCs{|jrg|j|j�}dt|jj�}dtd�dt|jj�|j|�f}n
d}}||fS(s4Return the href and subject for the previous messages <LINK REL="Previous"  HREF="%s">s<LI>sPrevious message:s <A HREF="%s">%s
</A></li>R(RYt_get_subject_encRR,R(R(RuR]RYR�((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyR��s	

cCs|jjd|j�S(s�Return the subject of art, decoded if possible.

        If the charset of the current message and art match and the
        article's subject is encoded, decode it.
        R](RiR@R](Rutart((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyR�scCs{|jrg|j|j�}dt|jj�}dtd�dt|jj�|j|�f}n
d}}||fS(s4Return the href and subject for the previous messages<LINK REL="Next"  HREF="%s">s<LI>s
Next message:s <A HREF="%s">%s
</A></li>R(RZR�RR,R(R(RuR]RZR�((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyR�
s	

s=([A-F0-9][A-F0-9])s=[ 	]*$cCs=y
|j}Wntk
r)|j}nXttj|��S(s<Return the message body ready for HTML, decoded if necessary(t	html_bodytAttributeErrorRsR!tEMPTYSTRINGR�(RuRs((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyR�s



cCsVxOd	d
ddfD];\}}|jj|�r|j|j|�||<qqWdS(
s$Add encoded-word keys to HTML outputRbR�RcR�R]R�R�N(sauthorsauthor_html(semails
email_html(ssubjectssubject_html(ssubjectstitle(RiR�R(RuR�tsrctdst((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyR�&scCs�|jj�}|jdd�j�sCtjtj��|d<n|jdd�j�shd|d<n|jdd�j�s�tjtj��|d<ndddd	g}|d
r�|jd�n|dr�|jd
�n|dr�|jd�ntj|j	�}t
j|j�}t
|tj�sGt||d�}ntjr�tj�}zFtj|j�ttd�|�}tjdd|d|�}Wdtj|�Xn|j|d�}tj|�|d|dS(NtfromdateRRcsbogus@does.not.exist.comtdatestrsFrom %(email)s  %(fromdate)ssFrom: %(email)s (%(author)s)sDate: %(datestr)ssSubject: %(subject)st_in_reply_tosIn-Reply-To: %(_in_reply_to)st_referencessReferences: %(_references)sR�sMessage-ID: %(_message_id)sRs at s([-+,.\w]+)@([-+.\w]+)s\g<1>s\g<2>s

s
(R�R�R@RmttimeR�tappendR�R�RsRRGR_R2R3R4RFRRaR
R)R*R(RdReR+RktNL(RuR�theadersRsR{R/R�((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytas_text/s>
	


		cCs,|j|�tjt|j��|_dS(N(t_Article__super_set_dateR�R�R�R�R�(RuRv((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyt	_set_dateVs
cCs|g|_d}xf|j�}|s(Pn|sO|j�dkrd}qqn|j�dkrePn|jj|�qdS(Nis<!--beginarticle-->is<!--endarticle-->(RstreadlineRmR�(Rutfileobjtbegintline((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytloadbody_fromHTMLZs		cCs+g|_y
|`Wntk
r&nXdS(N(RsR�R�(Ru((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytfinished_update_articleis
	

N(%t__name__t
__module__t	pipermailRTRRXR�R�R�t_last_article_timeR;RR=tweakreftWeakValueDictionaryR�R�R�R�R�RRtR�R�R�R�R�R�RdR�t	_rx_quotet_rx_softlineR�R�R�R�R�(((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyRTs4	J									)							'		tHyperArchivecBs�eZejjZejjZejjZ	ejj
ZdZdZ
dZdZdZdZdZdZdZdZdZd�Zd�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d�Z%d�Z&d�Z'd�Z(d�Z)d�Z*d�Z+d�Z,d�Z-d�Zd(Z.d#�Z/d$�Z0d%�Z1d&�Z2d'�Z3RS()i�i�itthreadtmonthiicCsv|j�}tj||�}|j|ddd|�||_d|_|j|_tj	|j�|_
t|jd�r|jjdkr�d|_
q|jjdkr�d|_
q|jjd	kr�d
|_
q|jjdkr�d|_
qd
|_
nd}d}d}id|dd6d|dd6d|dd
6d|||d
6d|||dd6|_dS(Ntreloaditdatabasetarchive_volume_frequencyityearitquarteritweekitdayR�s(?P<year>[0-9]{4,4})s(?P<month>[01][0-9])s(?P<day>[0123][0-9])t^t$sq(?P<quarter>[1234])$s-(?P<month>[a-zA-Z]+)$s
^Week-of-Mon-(tarchive_dirt
HyperDatabaset_HyperArchive__super_inittmaillistR;t
_lock_fileR>RRRGR}R�R�tARCHIVE_PERIODt_volre(RuR�tdirtdbtyretmretdre((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyR�s4		cCs"t||d|jjd|j�S(NRR:(RTR�R>(RutmsgRw((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyt_makeArticle�scs]�j}tj�}tj|j��fd�}z�i|�j�d6|�j�d6|jddd�d6�jd6t	|j
�j�d6}itd	�d	6td
�d
6td�d6td�d6}Wdtj
|�Xxh|j�D]Z}|d
j�|d}�j|kr*d|d|<q�d|||f|d|<q�Wtd|d|�S(Ncsttj|��j�S(N(RR
R�R(R(Ru(sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyt	quotetime�stlastdatetarchivedateR�R�itversionRLR�R]RbR�iRs%s_refs"<a href="%s.html#start">[ %s ]</a>sarchidxfoot.htmlR:(R�R
R)R*R>R�R�R�R�RR�RR(R+tkeystupperttypeRS(RuR:R/R�R�Rytttcap((Rush/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyt	html_foot�s0	


	cs��j}tj�}tj|j��fd�}z�it|j�j�d6�jd6�j	�j
�d6|jddd�d6|�j�d6|�j
�d	6�jd
6}itd�d6td�d6td
�d
6td�d6}Wdtj|�Xxv|j�D]h}|dj�|d}�j|krUd|d|<|||d<q	d|||f|d|<q	W�jr�t�j|d<n
d|d<td|d|�S(Ncsttj|��j�S(N(RR
R�R(R(Ru(sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyR��sRLtarchtypetarchiveR�R�it	firstdateR�R-R�R]RbR�iRs%s_refs"<a href="%s.html#start">[ %s ]</a>R�sarchidxhead.htmlR:(R�R
R)R*R>RR�RRt
volNameToDescRR�RR�R-R(R+R�RR}R�RS(RuR:R/R�R�RyRR((Rush/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyt	html_head�s<	



	
	c	Cs�|j}|j�}tjj|j�d|d�}i|jd6|jddd�d6d||fd6t||j	�d6d	d
6}t
j�}t
j|j	�z�|j
s�td�|d<d	|d
<d	|d<d	|d<n�d	|d<tdd|j	d|�|d
<tdd|�|d<g}x'|j
D]}|j|j|��q1Wtj|�|d<Wdt
j|�X|d
cttj|j	�7<tjr�d}nd}t||d|�S(Ns.mboxRLR�R�is../%s.mbox/%s.mboxtfullarchR-Rtmetas)<P>Currently, there are no archives. </P>t
noarchive_msgtarchive_listing_starttarchive_listing_endtarchive_listingsarchliststart.htmlRR:sarchlistend.htmlsarchtoc.htmlsarchtocnombox.html(R�R�R"R#R�R�R�R�R1R>R
R)R*tarchivesR(RSR�thtml_TOC_entryR�R+R�RRGRtPUBLIC_MBOX(	RuR:RLtmboxR�R/taccumtaRO((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pythtml_TOC�sF	#

	




	

 		cCstjj|jj�|d�}|d}tjj|�re|}|d}dtd�d}n?tjj|�r�|}|d}dtd�d}nd}|r�|i|d6t||jj	�d	6}nd
}t
di|d6|j|�d
6|d6d|j�S(Ns.txts.gzs.txt.gzs<td><A href="%(url)s">[ sGzip'd Text%(sz)ss
]</a></td>s
Text%(sz)sturltszRsarchtocentry.htmlRtarchivelabelttextlinkR:(R"R#R�R�R�texistsR(R;R1R>RSR(RutarchttxtfiletgzfiletfileRttemplR((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyR)s,"




cCsq|jr
dStjtjjtj|jj�d��|_y|jj	dd�Wntj
k
rldSXdS(Nis
-arch.lockttimeoutg�?i(R�RR"R#R�RtLOCK_DIRR�R�R�tTimeOutError(Ru((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytGetArchLockKs	cCs,|jr(|jjdd�d|_ndS(Ntunconditionallyi(R�tunlockR;(Ru((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytDropArchLockWs	cCs�|jj�}|d}|d}ytj|�Wnttjfk
rQdSX|j�sbdSy�t|�}tdd||�tj	d�}zt|d�}Wdtj	|�X|j
dd�|jd�d	kr�|jd	�n|j|j��|j
�|j
�tj|�Wntk
r4nXtj||�t|�}|j|�|j
�tj|�|j�dS(
Ns.workings.err_unarchivedR�sGArchive working file %s present.  Check %s for possibly unarchived msgsisa+iis
(R�tArchiveFileNameR"tstattIOErrorR�R$topenRtumasktseektreadtwritetclosetunlinktrenametprocessUnixMailboxR'(Rutnametwnametenametwftomaskteftarchfile((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytprocessListArch\sB








cCsd|jfS(Ns	%06i.html(Rw(Rutarticle((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytget_filename�scCs@|jt|j��}|jtd��|j|d�|S(s�Return a list of indexes where the article should be filed.
        A string can be returned if the list only contains one entry,
        and the empty list is legal.sfiguring article archives
s
(t
dateToVolNametfloatR�RvR((RuR<tres((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytget_archives�sc
Csx|j�}dtd�td�td�td�td�td�td�td	�td
�td�td�td
�g
}x�|jj�D]�}tj|j||�}|r�t|jd��}|dkr'dtd�td�td�td�g}|t|jd��}td�S|dkr�|jd�j�}xpt	dd�D]_}	t
jdd|	dddddddf	�}
|j�|
j�krX||	}td�SqXWtd|�qc|dkr|t|jd��}t|jd��}td�S|dkrS|t|jd��}t|jd��}td �S|jd�Sq�q�Wtd!|�dS("NRtJanuarytFebruarytMarchtApriltMaytJunetJulytAugustt	SeptembertOctobertNovembertDecemberR�R�tFirsttSecondtThirdtFourths%(ord)s quarter %(year)iR�ii
s%Bi�is%(month)s %(year)is%s is not a month!R�R�s-The Week Of Monday %(day)i %(month)s %(year)is%(day)i %(month)s %(year)is%s is not a valid volname(
RmR(R�R�RdR\R�tgroupRftrangeR�tstrftimeRI(
Rutvolnamet	monthdictteachR\R�R�tordtmonthstrRyt	monthnameR�R�((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyR�s>$$*-
-


cCs4tj|�}|jdkr.tjd|�S|jdkr�|ddkr]tjd|�S|ddkr}tjd|�S|ddkr�tjd|�Stjd|�Sn�|jdkr�tjd|�S|jdkr tj|�|d
ddd}tj|�}tjd|�Stjd|�SdS(NR�s%YR�iiis%Yq1iiis%Yq2iii	s%Yq3s%Yq4R�s%Y%m%dR�ii<sWeek-of-Mon-%Y%m%ds%Y-%B(iii(iii(iii	(R�t	localtimeR�RTtmktime(RuR�t	datetupletmonday((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyR>�s$#cCs�|j�}x�|jj�D]�}tj|j||�}|rt|jd��}d}d}|dkr�t|jd��}|dd}n�|dkr=|jd�j�}g}	xQtdd�D]@}
|	j	t
jdd	|
dd
d
d
d
dd
f	�j��q�Wy|	j|�d}Wq�t
k
r9q�XnE|dksU|dkr�t|jd��}t|jd��}ny,t
j||dd
d
d
d
dd
f	�SWq�tk
r�dSXqqWdS(NR�iR�iiR�i
s%Bi�iR�R�i����g(RmR�R�RdR\R�RRRfRSR�R�RTtindexRIR\t
OverflowError(RuRURWR\R�R�R�tqRYtmRy((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyt
volNameToDate�s88
,
csO�fd�}�jdkr1�jj|�n
�jj��jj�dS(NcsF�j|�}�j|�}||kr.dS||kr>dSdSdS(Nii����i(Rc(Rtbtaltbl(Ru(sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytsf�sR�R�R�(smonthsyearsquarter(R�Rtsorttreverse(RuRg((Rush/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytsortarchives�s
	
cCsP|jrLtj}|j|�|ddkr?|jd�n|j�ndS(Ni����s
(tVERBOSEtsyststderrR/tflush(RuR�tf((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyRvs		
cCsKtjj|d�}ytj|�WnnXtj|jd|�dS(Ns
index.htmls.html(R"R#R�R1tsymlinktDEFAULTINDEX(RuRt
archivedirt
index_html((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytopen_new_archivescCsQd|_|j�GH|jrM|jdkrM|jtd��|j�ndS(NitThreadsComputing threaded index
(tdepthR	t
THREADLAZYRRvR(tupdateThreadedIndex(Ru((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytwrite_index_headers
	cCs.xt|j�D]}dGHqW|j�GHdS(Ns</UL>(RSRvR(RuRy((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytwrite_index_footers	cCs�|jd|�}|jd|�}tjrcytjdtd�|�}Wqctk
r_qcXnt||j�}t||j�}it	j
|j�d6|d6|jd6|d6}t
d|d|j�GHdS(	NR]RbRUs at R,Rwsarchidxentry.htmlR:(t
get_headerRRaRdReR(RER8RRRR,RwRSR�(RuR<R]RbR�((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytwrite_index_entry"s"	


	cCs/|jj|�}|dkr+t||�S|S(N(RiR@R;R�(RuR�R<Rz((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyR{8s
cCs�|dkr"|jd�d}n||jkr=|j}n||jkrrxXt|j|�D]}dGHq`Wn5||jkr�x#t||j�D]}dGHq�Wnd||jfGH||_|j|�dS(Nisdepth<0s</UL>s<UL>s
<!--%i %s -->(RvtTHREADLEVELSRvRSt	threadKeyR|(RuR<RvRy((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytwrite_threadindex_entry@s
		cCsp|j�tjd�}z%ttjj|jd�d�}Wdtj|�X|j|j��|j	�dS(Nis
index.htmltw(
RjR"R,R+R#R�tbasedirR/RR0(RuR8ttoc((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyt	write_TOCPs
%cCs�tjd�}zt|d�}Wdtj|�X|j|j��|j�tjj|jd|�}tjd�}zt|d�}Wdtj|�X|j|j	��|j�dS(NiR�s%s.txtsa+(
R"R,R+R/R�R0R#R�R�R�(RuR_R<R#R8Ro((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyt
write_articleZs
c	Cs�|j|�tr�d}d}tjj|jd|�}tjj|jd|�}tjj|jd|�}yt|�}Wntk
r�dSXy#tj	||�tj|�}Wntt
tjfk
r�nXz%tjd�}tj|d�}Wdtj|�X|rD|j
|j��|j�tj|�ny+|j
|j��|j�|j�Wntk
r�nXtj|�ndS(Ns%s.txts	%s.txt.gzs
%s.old.txt.gziR�(t#_HyperArchive__super_update_archivetgzipR;R"R#R�R�R+R*R2tRuntimeErrorR�R,R/R.R0R1(	RuRtarchztarchtRtgzipfiletoldgziptoutnewz((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytupdate_archivens>




R�R�R}cCsYi}xL|jj�D];}||jkp:|j�|ks|j|||<qqW|S(N(R�R�t_skip_attrsR(RuR�RW((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytgetstate�scCsetd�}|rIt|dtj�rIt|tj|j�d�}n|}|}d}xtdt	|��D]�}||}}d}	}
|dkr�qrn|jr:tj
|�}|dkr�d}q:|jd�}t|| |j�d}	d}
|jr'|
d7}
|s'd|	}	q'n||}d}nd}tj|�}
tj|�}x�|
dk	sy|dk	r	|
dkr�d	}n|
jd�}|dkr�d	}n|jd�}|d	krL||ks�|d	krL|
jd�}t	|�}tjr9tjd
||�}|jjddd�}n
d
|}|}nU|d	kr�||ksp|d	kr�|jd�}}t	|�}|}n	td�|dt|| |j�t|�t||j�f7}|||}tj|�}
tj|�}qaW|
dkr7|dkr7t||j�}n|	|||
}d||<|||<qrWdS(Ns at iRRs<i>s</I>s<BR>ii����RUR�R�smailto:sj==k: This can't happen!s%s<A HREF="%s">%s</A>(R(R2R3R4RFRRGRtxrangetlenR;tIQUOTESt	quotedpatR\R^R8tSHOWHTMLtemailpattsearchturlpattstartRRRRaRdReR�R�RIR(RutlinesR�tsourcetdesttlast_line_was_quotedRytLorigtLR�tsuffixtquotedtL2tjrtkrtjtkRPtlengthtURLtpos((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyt__processbody_URLquote�sv!
			

			$		
	$		 
cCs|}|}t|�}d}x�||kr�x3||krctj||�dkrc|d}q1W||kr�d||<|d}nxL||kr�tj||�dkr�||d||<||<|d}q�W||kr"d||<|d}q"q"WdS(Nii(R�thtmlpatR\R;t	nohtmlpat(RuR�R�R�R~Ry((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyt__processbody_HTML�s (

(
cCs�td|j�}|jr+|j|�n|j|�|jrh|rh|jdd�|jd�nl|j	r�t
d�|�}nNxKtdt|��D]4}||}|dd!dkr�d|||<q�q�W||_
|S(Nis<PRE>s</PRE>cSs|dS(Ns<BR>((tx((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyt<lambda>sis 	
s<P>(tfilterR;Rst	ALLOWHTMLt_HyperArchive__processbody_HTMLt#_HyperArchive__processbody_URLquoteR�tinsertR�tSHOWBRtmapRSR�R�(RuR<R�RyR((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytformat_articles	
	
	c
Cs|j}tjj||j�}|jtd��y't|�}|j|�|j	�Wn>t
k
r�}|jtjkr��n|jtd��nX||_
||_tjd�}	zt|d�}Wdtj|	�X|j|j��|j	�dS(Ns!Updating HTML for article %(seq)ss%article file %(filename)s is missing!iR�(RwR"R#R�R,RvR(R+R�R0R*R&R'RYRZR,R/R�(
RutarcdirR<RYRZtseqR,RoR.R8((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pytupdate_article s&	
		(smaillists
_lock_filescharset(4R�R�R�tTRR�R�R�tupdate_dirty_archivest*_HyperArchive__super_update_dirty_archivestadd_articlet _HyperArchive__super_add_articletDIRMODEtFILEMODERkRqR�RwR}R�R�R�R�R�RR	RRR$R'R;R=RARR>RcRjRvRtRyRzR|R{RR�R�R�R�R�R�R�R�(((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyR�qs\	%		"	)	-	"			,				)											
		(	
	Q		(Lt__doc__t
__future__RRlRdR&RR�R"R3R�R�R�Rotemail.HeaderRRtemail.ErrorsRt
email.CharsetRtMailmanRRRRR	R
tMailman.SafeDictRtMailman.Logging.SyslogRtMailman.MailboxR
R(R;R�tGZIP_ARCHIVE_TXT_FILEStImportErrorR�R�tplatformtresourcet	getrlimittRLIMIT_STACKtsoftthardtmintmaxtnewsoftt	setrlimitRCtFalset	NameErrorRRR!R1R�R8R�tparen_name_patt
IGNORECASER[R�R�tblankpatR�R�R�R?RARSRTR�R�(((sh/builddir/build/BUILDROOT/mailman-2.1.15-30.el7_9.2.x86_64/usr/lib/mailman/Mailman/Archiver/HyperArch.pyt<module>s�		




			<�r

Zerion Mini Shell 1.0