ó Afc@sªddlZddlZddlZddlZddlZddlZddlZd„ZejdƒZ d„Z d„Z da dd„Z ed kr¦eƒndS( iÿÿÿÿNc Cs½t}y#tjtjddƒ\}}Wn7tjk rb}tjjd|ƒtjdƒnXx)|D]!\}}|dkrjt}qjqjW|s¡dg}nd}xù|D]ñ}|dksÌ|dkrä|tj ƒpÞ|}q®t j j |ƒr t |ƒp|}q®t j j|ƒr…yt|ƒ}Wn6tk re}tjjd ||fƒd}q®nX||ƒpu|}|jƒq®tjjd |ƒd}q®W|r¹tj|ƒndS( Nitfs%s is-ft-its%s: %s s%s: not found (tmmdftgetopttsystargvterrortstderrtwritetexittmessagetstdintostpathtisdirtmhtisfiletopentIOErrortclose( tdofiletoptstargstmsgtotatststargR((s0/usr/lib64/python2.7/Demo/scripts/mboxconvert.pytmains<#      s [1-9][0-9]*cCs»d}tj|ƒ}xŸ|D]—}tj|ƒt|ƒkrCqntjj||ƒ}yt|ƒ}Wn6tk r }t j j d||fƒd}qnXt |ƒp°|}qW|S(Nis%s: %s i( R tlistdirtnumerictmatchtlenRtjoinRRRRR R (tdirRtmsgsRtfnR((s0/usr/lib64/python2.7/Demo/scripts/mboxconvert.pyR2s cCsbd}xU|jƒ}|sPn|dkrCt||ƒp=|}q tjjd|fƒq W|S(Nis sBad line in MMFD mailbox: %r (treadlineR RRR (RRtline((s0/usr/lib64/python2.7/Demo/scripts/mboxconvert.pyRBs   iRc Cszd}tj|ƒ}|jdƒ\}}|jdƒ}|rQtj|ƒ}n<tjjd|j dƒfƒt j |j ƒƒt j}dG|Gtj|ƒGHx|jD] }|Gq­W|jdƒstdadt|ƒtf} tjjd| |fƒd G| GHnHxa|jƒ}||kr0Pn|sPtjjd ƒd}Pn|d d krmd |}n|GqWH|S(NitFromtDatesUnparseable date: %r s message-idis<%s.%d>sAdding Message-ID %s (From %s) s Message-ID:sUnexpected EOF in message isFrom t>(trfc822tMessagetgetaddrtgetdatettimetmktimeRRR t getheaderR tfstattfilenotstattST_MTIMEtctimetheadersthas_keytcounterthexR&( Rt delimiterRtmtfullnametemailtttttR'tmsgid((s0/usr/lib64/python2.7/Demo/scripts/mboxconvert.pyR Qs@       t__main__(R+RR/R R4RtreRtcompileRRRR9R t__name__(((s0/usr/lib64/python2.7/Demo/scripts/mboxconvert.pyts        !   *