???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................ó
Afc           @   sª   d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d „  Z e j d ƒ Z	 d „  Z
 d „  Z d a d d „ Z e d	 k r¦ e ƒ  n  d S(
   iÿÿÿÿNc    	      C   s½  t  }  y# t j t j d d ƒ \ } } Wn7 t j k
 rb } t j j d | ƒ t j d ƒ n Xx) | D]! \ } } | d k rj t }  qj qj W| s¡ d g } n  d } xù | D]ñ } | d k sÌ | d k rä |  t j	 ƒ pÞ | } q® t
 j j | ƒ rt | ƒ p| } q® t
 j j | ƒ r…y t | ƒ } Wn6 t k
 re} t j j d	 | | f ƒ d } q® n X|  | ƒ pu| } | j ƒ  q® t j j d
 | ƒ d } q® W| r¹t j | ƒ n  d  S(   Ni   t   fs   %s
i   s   -ft   -i    t    s   %s: %s
s   %s: not found
(   t   mmdft   getoptt   syst   argvt   errort   stderrt   writet   exitt   messaget   stdint   ost   patht   isdirt   mht   isfilet   opent   IOErrort   close(	   t   dofilet   optst   argst   msgt   ot   at   stst   argR    (    (    s0   /usr/lib64/python2.7/Demo/scripts/mboxconvert.pyt   main   s<    #
s   [1-9][0-9]*c         C   s»   d } t  j |  ƒ } xŸ | D]— } t j | ƒ t | ƒ k rC q n  t  j j |  | ƒ } y t | ƒ } Wn6 t k
 r  } t	 j
 j d | | f ƒ d } q n Xt | ƒ p° | } q W| S(   Ni    s   %s: %s
i   (   R   t   listdirt   numerict   matcht   lenR   t   joinR   R   R   R   R	   R   (   t   dirR   t   msgsR   t   fnR    (    (    s0   /usr/lib64/python2.7/Demo/scripts/mboxconvert.pyR   2   s    c         C   sb   d } xU |  j  ƒ  } | s Pn  | d k rC t |  | ƒ p= | } q	 t j j d | f ƒ q	 W| S(   Ni    s   
s   Bad line in MMFD mailbox: %r
(   t   readlineR   R   R   R	   (   R    R   t   line(    (    s0   /usr/lib64/python2.7/Demo/scripts/mboxconvert.pyR   B   s    	i    R   c   
      C   sz  d } t  j |  ƒ } | j d ƒ \ } } | j d ƒ } | rQ t j | ƒ } n< t j j d | j	 d ƒ f ƒ t
 j |  j ƒ  ƒ t j } d G| Gt j | ƒ GHx | j D]
 } | Gq­ W| j d ƒ st d a d t | ƒ t f }	 t j j d |	 | f ƒ d	 G|	 GHn  Hxa |  j ƒ  } | | k r0Pn  | sPt j j d
 ƒ d } Pn  | d  d k rmd | } n  | GqWH| S(   Ni    t   Fromt   Dates   Unparseable date: %r
s
   message-idi   s   <%s.%d>s   Adding Message-ID %s (From %s)
s   Message-ID:s   Unexpected EOF in message
i   s   From t   >(   t   rfc822t   Messaget   getaddrt   getdatet   timet   mktimeR   R   R	   t	   getheaderR   t   fstatt   filenot   statt   ST_MTIMEt   ctimet   headerst   has_keyt   countert   hexR&   (
   R    t	   delimiterR   t   mt   fullnamet   emailt   ttt   tR'   t   msgid(    (    s0   /usr/lib64/python2.7/Demo/scripts/mboxconvert.pyR   Q   s@    	
t   __main__(   R+   R   R/   R   R4   R   t   reR   t   compileR   R   R   R9   R   t   __name__(    (    (    s0   /usr/lib64/python2.7/Demo/scripts/mboxconvert.pyt   <module>   s   	!		*