Ńň
ubSc        
   @   s   d  d k  l Z d  d k l Z d  d k Z d  d k Z d  d k Z d  d k l Z d  d k l	 Z	 d  d k l
 Z
 d   Z d   Z d S(	   i˙˙˙˙(   t   exists(   t   PopenN(   t   bcol(   t	   calcWidth(   t   getColsc         C   sk   t  } x^ |  i   D]P \ } } | i | d  } | | j o% | p
 h  } n | | f | | <q q W| S(   Ni    (   t   Falset   itemst   get(   t   sourcet   destt   difft   kt   vt   v2(    (    s*   /root/bin/ikeamodules/ikea/posttransfer.pyt   compare   s     
c         C   ső  t    } d } Ht i d i | d  t i GHt | d d d d d d  } d i | d	  d
 i | d  d i | d  d i | d  d i | d  d i | d  GHt i	 d  } x+|  D]#} | i
 p	t i | i d t i d } t |  d | } t |  t | i d |   } t i | i t i }	 t |	  t | i d |	   }
 t i d t i } t |  t | i d |   } | i | d	 |  |	 i | d |
  | i | d |  GHPn | d 7} qĘ Wd  S(   Ni   s   ___Post-Transfer checkt   _i   i   i   i   s   #  Primary Domaini    t   Usert   Domainsi   t	   Databasesi   s   Email Acctsi   s   Disk Usage  i   s   \x1B\[[^A-Za-z]*[A-Za-z]t   primarydomaint    s   . t    s=   Unable to access the source account with the provided details(   R   R   t   HEADERt   ljustt   ENDCR   t   centert   rjustt   ret   compilet   cpanelt   infot   strt   lent   subt   FAILt   username(   t   acctst   columnst   countt   colst   aansit   acctt   domaint   c1t   a1t   c2t   a2t   c3t   a3(    (    s*   /root/bin/ikeamodules/ikea/posttransfer.pyt	   postCheck   s(    	g 
"""@(   t   os.pathR    t
   subprocessR   t   osR   t   syst   helpersR   R   R   R   R1   (    (    (    s*   /root/bin/ikeamodules/ikea/posttransfer.pyt   <module>   s   	