mò Àw™Dc @sýdZddddddddd d d d d g ZdkZdkZdkZdkZdkZdkZdkTdk Z dk l Z l Z lZlZdfd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZd efd„ƒYZd efd„ƒYZd efd„ƒYZd efd„ƒYZd efd„ƒYZdefd„ƒYZdefd„ƒYZeid jo d!„d"„Z ei!d#ƒndS($s-Base classes used elsewhere in the package. tConfigurableBaset ForkingBaset ConfInstancet ConfStringtConfBooltConfInttConfTupleOfStringstConfTupleOfTupleOfStringst ConfPasswordt ConfDirectorytConfFiletConfMaildirPatht ConfMboxPathN(t*(s eval_boolsexpand_user_varss lock_files unlock_filetConfItemcBs2tZeZded„Zd„Zdd„ZRS(NcCs:tiiƒ|_||_||_||_||_dS(N( t getmailcoretloggingtLoggertselftlogtnametdtypetdefaulttrequired(RRRRR((t;/usr/lib/python2.4/site-packages/getmailcore/baseclasses.pyt__init__)s    cCs(|djo |iSnt|ƒ‚dS(NR(tkeyRRtKeyError(RR((Rt __getitem__0s  cCsZ|djo|i|idƒ}n|djo,|iotd|iƒ‚n|iSnt |ƒ|i j oá||ijoÑ|i o$|i i d|i|i fƒn$|i i d|i||i fƒy9|i tjot|ƒ}n|i t|ƒƒ}WqVtttfj o+}td|i||i |fƒ‚qVXn|S(Ns,%s: missing required configuration parametersconverting %s to type %s sconverting %s (%s) to type %s s9%s: configuration value (%s) not of required type %s (%s)(tvaltNonet configurationtgetRRRtgetmailConfigurationErrorRttypeRt securevalueRtdebugtboolt eval_booltevalt ValueErrort SyntaxErrort TypeErrorto(RRRR+((Rtvalidate8s"    & $#+( t__name__t __module__tFalseR#RtTrueRRR,(((RR's cBstZded„ZRS(NcCs&ti||tid|d|ƒdS(NRR(RRRRttypest InstanceTypeRR(RRRR((RRZs(R-R.RR0R(((RRYscBstZded„ZRS(NcCs#ti||td|d|ƒdS(NRR(RRRRtstrRR(RRRR((RR_s(R-R.RR0R(((RR^scBstZded„ZRS(NcCs#ti||td|d|ƒdS(NRR(RRRRR%RR(RRRR((RRcs(R-R.RR0R(((RRbscBstZded„ZRS(NcCs#ti||td|d|ƒdS(NRR(RRRRtintRR(RRRR((RRgs(R-R.RR0R(((RRfscBs tZded„Zd„ZRS(NcCs ti||d|d|ƒdS(NRR(RRRRRR(RRRR((RRkscCs×ti||ƒ}y]|djp |djo d}nt|ƒ}t|ƒt jot dƒ‚n|}Wn4t t fj o"}t d|i|fƒ‚nXg}|D]}|t|ƒq±~}t |ƒS(Nts()s not a tuples%s: incorrect format (%s)(RR,RRRRR'ttupR"ttupleR(R)R+R!Rt_[1]titemR3tresult(RRRR6R+R8R9R:((RR,ns   '(R-R.RR0RR,(((RRjscBs tZded„Zd„ZRS(NcCs ti||d|d|ƒdS(NRR(RRRRRR(RRRR((RRscCsGti||ƒ}y]|djp |djo d}nt|ƒ}t|ƒt jot dƒ‚n|}Wn4t t fj o"}t d|i|fƒ‚nXxš|D]’}t|ƒt jot d|ƒ‚nt|ƒdjot d|ƒ‚nx;|D]3}t|ƒtjot d||fƒ‚qqWq­W|S( NR5s()s not a tuples%s: incorrect format (%s)s contained value "%s" not a tupleis!contained value "%s" not length 2s-contained value "%s" has non-string part "%s"(RR,RRRRR'R6R"R7R(R)R+R!RtlentpartR3(RRRR6R+R<((RR,‚s*   "(R-R.RR0RR,(((RR~scBstZeZRS(N(R-R.R0R#(((RR›scBs tZded„Zd„ZRS(NcCs ti||d|d|ƒdS(NRR(RRRRRR(RRRR((RRŸscCsgti||ƒ}|djodSnt|ƒ}tii |ƒpt d|i |fƒ‚n|S(Ns+%s: specified directory "%s" does not exist( RR,RRRRtexpand_user_varstostpathtisdirR!R(RRR((RR,¢s  (R-R.RR0RR,(((RR žscBs tZded„Zd„ZRS(NcCs ti||d|d|ƒdS(NRR(RRRRRR(RRRR((RR¯scCsgti||ƒ}|djodSnt|ƒ}tii |ƒpt d|i |fƒ‚n|S(Ns&%s: specified file "%s" does not exist( RR,RRRRR=R>R?tisfileR!R(RRR((RR,²s  (R-R.RR0RR,(((RR ®scBstZd„ZRS(NcCs¨ti||ƒ}|djodSn|idƒptd|iƒ‚nxSdD]K}t i i ||ƒ}t i i|ƒptd|i|fƒ‚qUqUW|S(Nt/s%s: maildir must end with "/"tcurtnewttmps,%s: maildir subdirectory "%s" does not exist(RCsnewRE(R R,RRRRtendswithR!RtsubdirR>R?tjoint subdirpathR@(RRRRIRG((RR,¿s !(R-R.R,(((RR ¾scBs tZded„Zd„ZRS(NcCs ti||d|d|ƒdS(NRR(RRRRRR(RRRR((RRÒscCs1ti||ƒ}|djodSnt|ƒ}tii |ƒpt d|i |fƒ‚nti |ti ƒ}ti|ƒ}ti|dƒ}t|ƒ|iddƒ|iƒ}t|ƒ|o%|d djot d|ƒ‚ny ti||i|ifƒWntj o }nX|S(Ns+%s: specified mbox file "%s" does not existsr+biisFrom s%s: not an mboxrd file(RR,RRRRR=R>R?RAR!RtopentO_RDWRtfdtfstatt status_oldtfdopentft lock_filetseektreadlinet first_linet unlock_filetutimetst_atimetst_mtimetOSErrorR+(RRRRPRNRLR+RT((RR,Õs(      (R-R.RR0RR,(((RR ÑscBs)tZdZd„Zd„Zd„ZRS(sbBase class for user-configurable classes. Sub-classes must provide the following data attributes and methods: _confitems - a tuple of dictionaries representing the parameters the class takes. Each dictionary should contain the following key, value pairs: - name - parameter name - type - a type function to compare the parameter value against (i.e. str, int, bool) - default - optional default value. If not preseent, the parameter is required. cKsÃtiiƒ|_|iiƒh|_x|iƒD]s\}}|i ƒdjo$|iid|t |ƒfƒn$|iid||t |ƒfƒ||i|twaittpidtrRYR+RltsignaltSIGCHLDt_ForkingBase__orig_handlert_ForkingBase__child_pidt_ForkingBase__child_statusR0t_ForkingBase__child_exited(RRst stackframeRuR+Rv((Rt_child_handlerAs   cCsJ|iidƒt|_d|_d|_titi |i ƒ|_ dS(NR5( RRR[R/R|RRzR{RwRxR~Ry(R((Rt_prepare_childOs    cCsx0|ip%|iid|ƒtidƒqW|i|jotd|i|fƒ‚nt i |i ƒo)td|it i |i ƒfƒ‚nt i |i ƒo)td|it i|i ƒfƒ‚nt i|i ƒptd|iƒ‚nt i|i ƒ}|S(Nswaiting for child %df1.0sgot child pid %d, not %ds!child pid %d stopped by signal %ds child pid %d killed by signal %dschild pid %d failed to exit(RR|RR[tchildpidttimetsleepRztgetmailOperationErrorR>t WIFSTOPPEDR{tWSTOPSIGt WIFSIGNALEDtWTERMSIGt WIFEXITEDt WEXITSTATUStexitcode(RR€RŠ((Rt_wait_for_childVs ))(R-R.RrR~RR‹(((RR9s   icCs|S(N(tx(RŒ((RtrscCs\g}|D]}|||ƒ|fq ~}|iƒg}|D]\}}||qB~S(N(R8tlR9RtlstRptunusedR(RŽRRRR8R9R((RRirs- Ri("Rrt__all__tsysR>RRwR1Rdtgetmailcore.exceptionstgetmailcore.loggingRtgetmailcore.utilitiesR&R=RQRURRRRRRRRR R R R tobjectRRt hexversionRitappend(RRRR R‘RR R&R RRQRRRUR’R RiRR1RRRwRRdR>RR=((Rt?s6-       2)?8