Ñò
ýÉªWc           @   s&   d  d k  Z  d e f d „  ƒ  YZ d S(   iÿÿÿÿNt   InstallComponentc           B   s@  e  Z d  Z d Z d Z d Z d Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d" d „ Z  d „  Z! e" d „  ƒ Z# e" d  „  ƒ Z$ e" d! „  ƒ Z% RS(#   t   DELETEt   UPGRADEt   INSTALLt   ROOTt   BASEc         C   s1   | |  _  g  |  _ d  |  _ d |  _ t |  _ d  S(   Nt    (   t   componentNamet   subComponentst   Nonet   parentComponentt   keyWordt   Falset   isFinalLeaf(   t   selfR   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyt   __init__
   s
    				c         C   s   t  |  i ƒ d j S(   Ni    (   t   lenR   (   R   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyt   hasSubComponent   s    c         C   s5   |  i  |  i ƒ o t |  i ƒ d j S|  i ƒ  Sd  S(   Ni   (   t   getInstallComponentByNamet
   BASE_STUFFR   R   R   (   R   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyt   hasSubComponentExceptBase   s    c         C   s   |  i  i | ƒ |  | _ |  S(   N(   R   t   appendR
   (   R   t   subComponent(    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyt   addSubComponent   s    	c         C   s   |  i  S(   N(   R   (   R   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyt   getSubComponents   s    c         C   s1   |  i  |  i ƒ p |  i t |  i ƒ ƒ n |  S(   N(   R   R   R   R    (   R   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyt   appendBaseComponent"   s    c         C   s0   x) |  i  ƒ  D] } | i | j o | Sq Wd  S(   N(   R   R   R	   (   R   t   nameR   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyR   '   s
     	c         C   sF   |  i  d |  i ƒ  GH|  i o" x |  i D] } | i ƒ  q* Wn d  S(   Ns   : (   R   t   getConfigLocationR   t   printMe(   R   R   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyR   -   s
    

 c         C   s   t  i |  _ d  S(   N(   R    t   KEYWORD_DELETER   (   R   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyt   setAsDelete3   s    c         C   s   t  i |  _ d  S(   N(   R    t   KEYWORD_UPGRADER   (   R   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyt   setAsUpgrade6   s    c         C   s   t  i |  _ d  S(   N(   R    t   KEYWORD_INSTALLR   (   R   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyt   setAsInstall9   s    c         C   s   |  i  t i j S(   N(   R   R    R   (   R   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyt	   isUpgrade<   s    c         C   s   |  i  t i j S(   N(   R   R    R   (   R   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyt   isDelete?   s    c         C   s   |  i  t i j S(   N(   R   R    R!   (   R   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyt	   isInstallB   s    c         C   s   t  |  _ d  S(   N(   t   TrueR   (   R   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyt   setAsFinalLeaveE   s    c         C   s   |  i  |  i j S(   N(   R   t	   ROOT_NAME(   R   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyt   isRootH   s    c         C   s   |  i  |  i j S(   N(   R   R   (   R   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyt   isBaseK   s    c         C   sN   |  i  o2 |  i  i |  i j o |  i  i ƒ  |  i t i S|  i t i Sd  S(   N(   R
   R   R(   R   t   ost   sep(   R   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyR   N   s     c         C   s   |  i  | ƒ i ƒ  S(   N(   t   substractRecursivelyt'   removeNonLeafComponentIfNoSubcomponents(   R   t   anotherComponent(    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyt	   substractT   s    c         C   sŸ   |  i  ƒ  oŽ x‹ t t d t |  i  ƒ  ƒ ƒ ƒ D]d } |  i  ƒ  | } | i | i ƒ } | o5 | i ƒ  o | i | ƒ q“ |  i  ƒ  i | ƒ q/ q/ Wn |  S(   Ni    (	   R   t   reversedt   rangeR   R   R   R   R-   t   remove(   R   R/   t   iR   t   anotherSubComponent(    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyR-   W   s    " c         C   s‹   |  i  ƒ  oz xw t t d t |  i ƒ  ƒ ƒ ƒ D]P } |  i ƒ  | } | i ƒ  | i  ƒ  o" | i o |  i ƒ  i | ƒ q/ q/ Wn |  S(   Ni    (   R   R1   R2   R   R   R.   R   R3   (   R   R4   R   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyR.   d   s    " 
c         C   s^   xW | i  ƒ  D]I } |  i | i ƒ p |  i | i ƒ  ƒ q |  i | i ƒ i | ƒ q W|  S(   N(   R   R   R   R   t   copyt   merge(   R   R/   R   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyR7   m   s     c         C   sŽ   |  i  ƒ  o} xz t t d t |  i ƒ  ƒ ƒ ƒ D]S } |  i ƒ  | } | i | i ƒ } | p |  i ƒ  i | ƒ q/ | i | ƒ q/ Wn |  S(   Ni    (	   R   R1   R2   R   R   R   R   R3   t	   intersect(   R   R/   R4   R   R5   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyR8   u   s    " c         C   sU   t  |  i ƒ } |  i | _ |  i | _ x' |  i ƒ  D] } | i | i ƒ  ƒ q4 W| S(   N(   R    R   R   R   R   R   R6   (   R   t   copiedComponentR   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyR6   €   s     c         C   s}   |  i  ƒ  p$ | p
 | i o |  i ƒ  qy nI xE |  i ƒ  D]7 } | o | i | i | i ƒ ƒ q> | i d ƒ q> W|  S(   sÖ   
            Resolve all final leaf nodes by the full components tree, if the fullInstallComponent is None, it indicates the object itself is a fullInstallComponent, the leaf nodes of it can be found out. 
        N(   R   R   R'   R   t   resolveLeavesR   R   R	   (   R   t   fullInsatllComponentR   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyR:   ˆ   s     c         C   sZ   h  } |  i  | d <|  i o9 g  | d <x, |  i D] } | d i | i ƒ  ƒ q1 Wn | S(   NR   R   (   R   R   R   t   toJsonObject(   R   t   jsonObjR   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyR<   —   s    


 c         C   sj   |  p d  St |  d ƒ } |  i d ƒ o: |  d o/ x, |  d D] } | i t i | ƒ ƒ qB Wn | S(   NR   R   (   R	   R    t   has_keyR   t   fromJsonObject(   R=   t	   componentR   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyR?       s     c         C   s<   t  t  i ƒ } |  o" x |  D] } | i | ƒ q Wn | S(   N(   R    R(   R   (   t   componentListt   rootInstallComponentR@   (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyt!   createRootInstallComponentForListª   s     c           C   s   t  i d  ƒ S(   N(   R    RC   R	   (    (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyt   createEmptyInstallComponent²   s    N(&   t   __name__t
   __module__R   R   R!   R(   R   R   R   R   R   R   R   R   R   R   R    R"   R#   R$   R%   R'   R)   R*   R   R0   R-   R.   R7   R8   R6   R	   R:   R<   t   staticmethodR?   RC   RD   (    (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyR       sD   																											
(   R+   t   objectR    (    (    (    sj   /home/jenkins/workspace/prepack-aio-release-4.2/prepack-aio/src/main/resources/scripts/InstallComponent.pyt   <module>   s   