Ńň
ýÉŞWc           @   s   d  d k  Z  d  d k Z d  d k l Z d  d k l Z d e f d     YZ e d j o  e   Z e i e i	    n d S(   i˙˙˙˙N(   t   InstallComponent(   t   ComponentSelectionConfigt   ListInstalledComponentsc           B   sX   e  Z d  Z d Z e e i e Z d Z d   Z e	 d    Z
 d   Z d d  Z RS(   s   /opt/tandbergtv/cms/prepacks   installedcomponent.jsons   component-selections.jsonc         C   sT   t  i i |  i  o: t i t i |  i   |  _ |  i i	   i
   |  _ n d  S(   N(   t   ost   patht   existst   COMPONENT_SELECTION_CONFIGR   t   fromJsonR   t   loadFromJsont   fullComponentSelectionConfigt   constructInstallComponentst   resolveLeavest   fullInstallComponents(   t   self(    (    sq   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/ListInstalledComponents.pyt   __init__   s    c         C   sA   t  i i |   p d  St |   } t i |  } | i   | S(   N(   R   R   R   t   Nonet   opent   jsont   loadt   close(   t   jsonFilet	   json_datat
   jsonObject(    (    sq   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/ListInstalledComponents.pyR      s    
c         C   sE   t  i   } t i i |  i  o t  i t i |  i   } n | S(   N(	   R    t   createEmptyInstallComponentR   R   R   t   INSTALLED_COMPONENTSt   fromJsonObjectR   R   (   R   t   installedComponents(    (    sq   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/ListInstalledComponents.pyt   getInstalledComponents   s    t    c         C   s   | i    o | i   o	 d GHn | i    o7 | i   o) | d } | |  i i | i  i GHn x$ | i   D] } |  i | |  qv Wd  S(   Ns       No Component is selecteds   --|-(	   t   isRoott   hasSubComponentt   isBaseR	   t   getSelectionConfigt   componentNamet   displayNamet   getSubComponentst   printInstallComponents(   R   t
   componentst   intentt   subComponent(    (    sq   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/ListInstalledComponents.pyR$       s    	
 (   t   __name__t
   __module__t   PREPACK_DIRt   INSTALLED_COMPONENTS_FILE_NAMER   t   sepR   R   R   t   staticmethodR   R   R$   (    (    (    sq   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/ListInstalledComponents.pyR      s   			t   __main__(
   R   R   R    R   t   objectR   R(   t	   collectorR$   R   (    (    (    sq   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/ListInstalledComponents.pyt   <module>   s   #	