Ñò
ýÉªWc        
   @   se  d  d k  Z  d  d k Z d  d k Z d  d k Z d  d k Z d d d d d g Z d d d „  ƒ  YZ d e f d „  ƒ  YZ d e f d	 „  ƒ  YZ d e f d
 „  ƒ  YZ	 d e f d „  ƒ  YZ
 e d j o˜ d Z e i e ƒ e ƒ  Z d e _ e i ƒ  GHe ƒ  Z d e _ e i ƒ  GHe	 ƒ  Z d e _ e i ƒ  GHe
 ƒ  Z d e _ e i ƒ  GHe i e ƒ n d S(   iÿÿÿÿNt   FileCollectort   RetentionDayFileCollectort    RetentionMinEmptyFolderCollectort   ContentFileHavingLWECollectort   OnlyLWEFileCollectorc           B   s5   e  Z d  Z d Z d Z d „  Z d „  Z d „  Z RS(   s   .ingestFromHoldFolder.indicators   *.lwe.*s   /content/unmapped/c      	   C   sù   t  i ƒ  |  _ y¬ t i i t i i t ƒ ƒ } t i i | d ƒ } t	 | ƒ i
 i ƒ  } z | ~ } | i ƒ  } Wd  QXt i ƒ  |  _ |  i i t i | ƒ ƒ |  i i d d ƒ t _ Wn7 t j
 o+ } |  i i d | d t | ƒ ƒ n Xd  S(   Ns   HouseKeepProperties.initt   RetentionDirectoryt   UNMAPPED_CONTENT_PATHs   Parse configuration file: s	    failed. (   t   loggingt	   getLoggert   loggert   ost   patht   dirnamet   realpatht   __file__t   joint   opent   __exit__t	   __enter__t   readt   ConfigParsert   RawConfigParsert   configt   readfpt   iot   BytesIOt   getR    R   t	   Exceptiont   errort   str(   t   selft   cwdt   propertiesFilePatht   _[1]t   ft
   propertiest   e(    (    s   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/components/BASE/conf/opt/tandbergtv/cms/cronjob/FileCollector.pyt   __init__   s    #c         C   s   d  S(   N(    (   R   (    (    s   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/components/BASE/conf/opt/tandbergtv/cms/cronjob/FileCollector.pyt   collectFiles   s    c         C   s=   x6 t  i | ƒ D]% } t i | | t i ƒ o t Sq Wt S(   N(   R
   t   listdirt   fnmatchR    t   LICENSE_WINDOW_END_PATTERNt   Truet   False(   R   t   fileNamet   dirt   fName(    (    s   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/components/BASE/conf/opt/tandbergtv/cms/cronjob/FileCollector.pyt   RelatedLWEFileExist   s
     	(   t   __name__t
   __module__t   HOLD_FOLDER_INDICATORR)   R   R%   R&   R/   (    (    (    s   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/components/BASE/conf/opt/tandbergtv/cms/cronjob/FileCollector.pyR    	   s   		c           B   s   e  Z d  „  Z RS(   c         C   sx   g  } xk t  i |  i ƒ D]W \ } } } xE | D]= } t  i | t  i | ƒ p | i | t  i | ƒ q/ q/ Wq W| S(   N(   R
   t   walkR   R'   t   sept   append(   R   t   foldersPatht
   currentDirt   subFolderNamest   subFilesNamest
   folderName(    (    s   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/components/BASE/conf/opt/tandbergtv/cms/cronjob/FileCollector.pyR&   (   s      $(   R0   R1   R&   (    (    (    s   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/components/BASE/conf/opt/tandbergtv/cms/cronjob/FileCollector.pyR   '   s   c           B   s   e  Z d  „  Z RS(   c         C   s§   g  } xš t  i |  i ƒ D]† \ } } } xt | D]l } | i t i ƒ o q/ n t i | t i ƒ o q/ n |  i | | ƒ p | i	 | t  i
 | ƒ q/ q/ Wq W| S(   N(   R
   R3   R   t   endswithR    R2   R(   R)   R/   R5   R4   (   R   t	   filesPathR7   R8   R9   R,   (    (    s   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/components/BASE/conf/opt/tandbergtv/cms/cronjob/FileCollector.pyR&   7   s      $(   R0   R1   R&   (    (    (    s   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/components/BASE/conf/opt/tandbergtv/cms/cronjob/FileCollector.pyR   6   s   c           B   s   e  Z d  „  Z RS(   c         C   s§   g  } xš t  i |  i ƒ D]† \ } } } xt | D]l } | i t i ƒ o q/ n t i | t i ƒ o q/ n |  i | | ƒ o | i	 | t  i
 | ƒ q/ q/ Wq W| S(   N(   R
   R3   R   R;   R    R2   R(   R)   R/   R5   R4   (   R   R<   R7   R8   R9   R,   (    (    s   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/components/BASE/conf/opt/tandbergtv/cms/cronjob/FileCollector.pyR&   J   s      $(   R0   R1   R&   (    (    (    s   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/components/BASE/conf/opt/tandbergtv/cms/cronjob/FileCollector.pyR   I   s   c           B   s   e  Z d  „  Z d „  Z RS(   c         C   s   g  } x€ t  i |  i ƒ D]l \ } } } xZ | D]R } t i | t i ƒ p q/ n |  i | | ƒ p | i | t  i | ƒ q/ q/ Wq W| S(   N(	   R
   R3   R   R(   R    R)   t   relatedContentFileExistR5   R4   (   R   R<   R7   R8   R9   R,   (    (    s   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/components/BASE/conf/opt/tandbergtv/cms/cronjob/FileCollector.pyR&   ]   s      $c         C   s,   t  i i | t  i | d t | ƒ d !ƒ S(   Ni    i   (   R
   R   t   existsR4   t   len(   R   t   lweFileNameR7   (    (    s   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/components/BASE/conf/opt/tandbergtv/cms/cronjob/FileCollector.pyR=   g   s    (   R0   R1   R&   R=   (    (    (    s   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/components/BASE/conf/opt/tandbergtv/cms/cronjob/FileCollector.pyR   \   s   	
t   __main__s@   ..\..\..\..\..\..\..\scripts\res\houseKeep\ericsson.com\20151207s*   ../../../../../../../scripts/res/houseKeep(    (   R   R
   R(   R   R   t   __all__R    R   R   R   R   R0   t   emptyfoldert   mkdirt   retentionDayFileCollectorR   R&   t   retentionDayEmptyFoldert   lweFileCollectort   onlyLWEFileCollectort   rmdir(    (    (    s   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/components/BASE/conf/opt/tandbergtv/cms/cronjob/FileCollector.pyt   <module>   s4   								