#NEWLINE# def construct_yaml_omap( self , node ) : #NEWLINE# #INDENT# omap = [ ] #NEWLINE# ( yield omap ) #NEWLINE# if ( not isinstance ( node , SequenceNode ) ) : #NEWLINE# #INDENT# raise ConstructorError ( 'while constructing an ordered map' , node . start_mark , ( 'expected a sequence, but found %s' % node . id ) , node . start_mark ) #NEWLINE# #UNINDENT# for subnode in node . value : #NEWLINE# #INDENT# if ( not isinstance ( subnode , MappingNode ) ) : #NEWLINE# #INDENT# raise ConstructorError ( 'while constructing an ordered map' , node . start_mark , ( 'expected a mapping of length 1, but found %s' % subnode . id ) , subnode . start_mark ) #NEWLINE# #UNINDENT# if ( len ( subnode . value ) != 1 ) : #NEWLINE# #INDENT# raise ConstructorError ( 'while constructing an ordered map' , node . start_mark , ( 'expected a single mapping item, but found %d items' % len ( subnode . value ) ) , subnode . start_mark ) #NEWLINE# #UNINDENT# ( key_node , value_node ) = subnode . value [ 0 ] #NEWLINE# key = self . construct_object ( key_node ) #NEWLINE# value = self . construct_object ( value_node ) #NEWLINE# omap . append ( ( key , value ) )