
    h                     @    S r SSKrSSKrSSKrSSKJr   " S S5      rg)zFORked report PlumIs    N)Reconc                   4    \ rS rSrSS jrSS jrS rS rSrg)	Forpi
   c                 t    Xl         UR                  U l        S U l        [        U R                  5      U l        g )N)plumiemother_repcoder   recon)selfr   
do_verboses      !/home/ernad/ernad/python/forpi.py__init__Forpi.__init__   s.    
 #466]
    c                 *   U R                   nXR                  ;  a  [        SU-   5        gUR                  U   nUR                  S   nUR                  U   nUR                  S   n[        R
                  R                  U5      (       d  [        S[        R                  S9  gU R                  R                  USS9n[        U5      nUS	:X  a  [        S
[        R                  S9  gU R                  U5      n[        U5       H  n	X;   d  M
  X	 M     [        U5      n
Xz:  aI  [        SU 35        [        R
                  R                  U5      (       a  [        R                  " U5        gU R                   R                   R                  USS9n[        [        U5      5      nX-
  US-
  :X  a  [        S5        gXU-
  S-   :  a  [        S[        R                  S9  gX-
  U-   S-
  n[        U5      U* S  HC  nX   n[        R
                  R#                  U5      (       d  M-  [        R$                  " U5        ME     U R                   R                   R                  USS9n[        [        U5      5      nUS	:X  a  [        R                  " U5        g)zupdate for a reportzI don't know your report Fforpiz.forpi: this should not run with no {forpi_dir}fileNT)	no_motherr   z1forpi: forpi.update should not have been invoquedzforpi removes its folder z.txt.gz)ext   zforpi is doing just fine!z forpi does not have enough files)r	   reportprintdirsospathisdirsysstderrr   dafuslenmother_dafuslistshutilrmtreefoldaisfileremove)r   repcoder   r	   r   	forpi_dirchild_dafuscount_childr#   	issuedatecount_mothercopid_dafuscount_copidcount_to_godatefufis                   r   updateForpi.update   s:   FF(("-78'"KK(	'"KK(	ww}}Y''Bzz#jj&&w$&?+&!Ezz#((1l+I' + , <(%-i[9:ww}}Y''i(ffll((	(B${+,%q8-.3a77 4zz#!0;>B %{lm4D$Dww~~d##		$ 5
 ffll((	(B${+,!MM)$r   c                    U R                   nUR                  U   nUR                  S   n[        R                  R                  U5      (       a  [        SU S3[        R                  S9  g[        R                  " U5        U R                  U5      nU H  n[        R                  " XV   U5        M     U R                  $ )Nr   zforpi: I see z, no create.r   F)r	   r   r   r   r   r   r   r   r    makedirsr#   r%   copyr
   )r   r*   r	   r   r+   r#   r.   s          r   createForpi.createW   s    FF'"KK(	77==## M)L9zz#
I ((1%IKK/; &"""r   c                    U R                   R                  U5      n[        U5      S   nX0l        X#   nU R                  R                  U5      nUc  U$ 0 nU H  nXt:  a  M
  XW   Xg'   M     U H  nXt:  a  M
  XW   Xg'   M     U$ )z2takes into account the limit, but not child plumisr   )r   get_mothersr$   r
   r   r!   )r   r*   mothersr
   mother_limitr#   r!   r.   s           r   r#   Forpi.mother_dafusj   s    **((1gq),.zz''7%I'+6E &
 &I'+6E & r   )r	   r
   r   r   N)F)	__name__
__module____qualname____firstlineno__r   r5   r:   r#   __static_attributes__ r   r   r   r   
   s    ;z#&r   r   )__doc__r   r   r%   r   r   r   rF   r   r   <module>rH      s      	 
  v vr   