#NEWLINE# def __init__( self , manifest , backname = 'root' ) : #NEWLINE# #INDENT# self . backname = backname #NEWLINE# self . manifest = manifest #NEWLINE# for ( key , item ) in self . manifest . items ( ) : #NEWLINE# #INDENT# type_ = type ( item ) #NEWLINE# is_program = isinstance ( item , Program ) #NEWLINE# is_manifest = ( type_ == Manifest ) #NEWLINE# is_list = ( type_ == list ) #NEWLINE# is_str = ( type_ == str ) #NEWLINE# if ( not key_regex . match ( key ) ) : #NEWLINE# #INDENT# raise ValueError ( ( 'Invalid manifest key: %s' % key ) ) #NEWLINE# #UNINDENT# if ( type_ is dict ) : #NEWLINE# #INDENT# self . manifest [ key ] = Manifest ( item , backname = key ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not any ( [ is_manifest , is_program , is_list , is_str ] ) ) : #NEWLINE# #INDENT# msg = 'Manifest value must be either: a program, a list of programs, or another manifest' #NEWLINE# raise TypeError ( msg )