V Qc@sddlZddlZddlZddlZddlZejjdZdZdZ dZ eZ dZ dZ dZd Zd ZxXejejd fD]@Zejjed ZejjereGHeePqqWdd lmZddlTdZdjedejZiaejjee Z ejjee Z ejjee ZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)e*dkre)ndS(iNs ~/newspagesnews.example.comt grouptreet newsgroupsttrootis;... itHOMEs.newslistrc.py(tNNTP(t*s $Revision$t cCs d|kS(Nt$((ts((s-/usr/lib64/python2.7/Demo/scripts/newslist.pytmscCs6dGHx*|D]"}|jd}t||q WdS(NsUpdating tree...t.(tsplittmakeleaf(ttreetgroupstitparts((s-/usr/lib64/python2.7/Demo/scripts/newslist.pyt addtotreexs cCst|d}t|}||kr/i|| s&Newsgroups available%s s s

Newsgroups available%s

s-Back to top level

is

s7This page automatically created by 'newslist' v. %s.s s ( tosRtjointpagedirtrootpagetopentwritethttppreft printtreetrcsrevttimetctime(RRtptfilenametdetailtf((s-/usr/lib64/python2.7/Demo/scripts/newslist.pyt createpages"         cCst|}|tkr}|dkr}|jdt|df|j|dd|jdtt|d||dS|j}|dkr|j|dkr|jd|dn |jd|d}nx|D]}|dkrQ|jd |d|df|dtkrA|jd t|dqp|jd qt |||||d|qW|dkr|jd ndS( Nis

  • is.*s %s s
  • %s
      s
        R s
      • %s s %s s s
      ( Rt sublistsizeRRt pagelinkiconR'tkeystsorttdescR(R&RtindentR#RtklR((s-/usr/lib64/python2.7/Demo/scripts/newslist.pyRs.         # c Csia|dkrdSyt|d}}dGHxn|D]f}|j}y@|d}dj|d}t|dkr|t|RtmarshaltloadR1(ttreefileRttreetimettreedatetdump((s-/usr/lib64/python2.7/Demo/scripts/newslist.pyt readlocallists   #  cCs`y7t|d}tj||}WdQXd|GHWn"dG|GHdGHtjdnXdS(NtwbsSaved list to %s s,Sorry - failed to write to local group caches8Does it (or its directory) have the correct permissions?i(RRDRIR:R>(RFRRIR((s-/usr/lib64/python2.7/Demo/scripts/newslist.pytwritelocallists  cCsdGHd}|jd}g}dGHtr4dGHnx`|D]X}|djd}trt|dt|dkr|dGq;|j|q;Wd GHtrd GHn|S( NsGetting list of all groups...t010101is Processing...s! Ignoring following empty groups:iiRs s(End of empty groups)(tlistt skipemptyR tinttappend(tserverRHtinfoRRtgrpname((s-/usr/lib64/python2.7/Demo/scripts/newslist.pyt getallgroupss  & cCsnd|G|j|dd}dt|GHdGg}x+|D]#}|jd}|j|q>WdGH|S(Ns/Getting list of new groups since start of %s...t000001isgot %d.s Processing...itDone(t newgroupsRR RQ(RRRHRSRRRT((s-/usr/lib64/python2.7/Demo/scripts/newslist.pyt getnewgroups/s cCs<i}ttyDdtGHtjddkrAtjt}n tt}t}Wn3tj tj fk r}dG|GHdGHt }nX|rt tj dkrtj ddkrt|}n*tt\}}|rt||}n|rt||tt|nttdGHtt|d d GHdS( NsConnecting to %s...it0sError connecting to host:s$I'll try to use just the local list.is-asCreating pages...RRW(R?RtnewshostR:tversionRtinittTruetnntplibt error_tempt error_permtFalseRtargvRURJRFRYRRLR7R2R'R(RR t connectedtxRRH((s-/usr/lib64/python2.7/Demo/scripts/newslist.pytmain=s0      .  t__main__(+R:R_RDR!RRt expanduserttopdirR[RFR2RRRROR)R(tcurdirtenvirontdirRtrcfiletexiststexecfileRRBR tfilterR R,tpageRR R'RR7R?RJRLRURYRft__name__(((s-/usr/lib64/python2.7/Demo/scripts/newslist.pyt#sJ<   !    *      )