#NEWLINE# def __init__( self , raw ) : #NEWLINE# #INDENT# if ( type ( self ) is not dict ) : #NEWLINE# #INDENT# raise ValueError ( ( 'Invalid version object (expected dict, found %s' % type ( raw ) ) ) #NEWLINE# #UNINDENT# if ( 'name' not in raw ) : #NEWLINE# #INDENT# raise ValueError ( "Invalid version object (no 'name' value)" ) #NEWLINE# #UNINDENT# if ( not isinstance ( raw [ 'name' ] , string_types ) ) : #NEWLINE# #INDENT# raise ValueError ( ( "Invalid version object (expected 'name' to be str, was %s)" % type ( raw [ 'name' ] ) ) ) #NEWLINE# #UNINDENT# self . name = raw [ 'name' ] #NEWLINE# if ( 'protocol' not in raw ) : #NEWLINE# #INDENT# raise ValueError ( "Invalid version object (no 'protocol' value)" ) #NEWLINE# #UNINDENT# if ( type ( raw [ 'protocol' ] ) is not int ) : #NEWLINE# #INDENT# raise ValueError ( ( "Invalid version object (expected 'protocol' to be int, was %s)" % type ( raw [ 'protocol' ] ) ) ) #NEWLINE# #UNINDENT# self . protocol = raw [ 'protocol' ]