<s> import copy <EOL> import os <EOL> import zipfile <EOL> from qisys import ui <EOL> import qipkg . metapackage <EOL> import qipkg . builder <EOL> class MetaPMLBuilder ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , mpml_path , worktree = None ) : <EOL> ui . info ( ui . green , "<STR_LIT>" , ui . reset , ui . bold , <EOL> "<STR_LIT>" , mpml_path , "<STR_LIT:\n>" ) <EOL> self . worktree = worktree <EOL> self . mpml_path = mpml_path <EOL> self . meta_package = qipkg . metapackage . MetaPackage ( self . worktree , self . mpml_path ) <EOL> self . pml_builders = list ( ) <EOL> pml_paths = self . meta_package . pml_paths <EOL> for pml_path in pml_paths : <EOL> pml_builder = qipkg . builder . PMLBuilder ( pml_path , worktree = worktree ) <EOL> self . pml_builders . append ( pml_builder ) <EOL> def configure ( self ) : <EOL> """<STR_LIT>""" <EOL> n = len ( self . pml_builders ) <EOL> for i , pml_builder in enumerate ( self . pml_builders ) : <EOL> ui . info ( ui . green , "<STR_LIT>" , ui . reset , ui . bold , "<STR_LIT>" % ( ( i + <NUM_LIT:1> ) , n ) , <EOL> "<STR_LIT>" , pml_builder . pml_path ) <EOL> pml_builder . configure ( ) <EOL> def build ( self ) : <EOL> """<STR_LIT>""" <EOL> n = len ( self . pml_builders ) <EOL> for i , pml_builder in enumerate ( self . pml_builders ) : <EOL> ui . info ( ui . green , "<STR_LIT>" , ui . reset , ui . bold , "<STR_LIT>" % ( ( i + <NUM_LIT:1> ) , n ) , <EOL> "<STR_LIT>" , pml_builder . pml_path ) <EOL> pml_builder . build ( ) <EOL> def install ( self , dest ) : <EOL> """<STR_LIT>""" <EOL> n = len ( self . pml_builders ) <EOL> for i , pml_builder in enumerate ( self . pml_builders ) : <EOL> ui . info ( ui . green , "<STR_LIT>" , ui . reset , ui . bold , "<STR_LIT>" % ( ( i + <NUM_LIT:1> ) , n ) , <EOL> "<STR_LIT>" , pml_builder . pml_path ) <EOL> pml_builder . install ( dest ) <EOL> def deploy ( self , url ) : <EOL> """<STR_LIT>""" <EOL> n = len ( self . pml_builders ) <EOL> for i , pml_builder in enumerate ( self . pml_builders ) : <EOL> ui . info ( ui . green , "<STR_LIT>" , ui . reset , ui . bold , "<STR_LIT>" % ( ( i + <NUM_LIT:1> ) , n ) , <EOL> "<STR_LIT>" , pml_builder . pml_path ) <EOL> pml_builder . deploy ( url ) <EOL> def package ( self , with_breakpad = False , output = None , force = False ) : <EOL> """<STR_LIT>""" <EOL> all_packages = list ( ) <EOL> n = len ( self . pml_builders ) <EOL> for i , pml_builder in enumerate ( self . pml_builders ) : <EOL> ui . info ( ui . green , "<STR_LIT>" , ui . reset , ui . bold , "<STR_LIT>" % ( ( i + <NUM_LIT:1> ) , n ) , <EOL> "<STR_LIT>" , pml_builder . pml_path ) <EOL> packages = pml_builder . package ( with_breakpad = with_breakpad , force = force ) <EOL> if isinstance ( packages , list ) : <EOL> all_packages . extend ( packages ) <EOL> else : <EOL> all_packages . append ( packages ) <EOL> return all_packages </s>
