#NEWLINE# def from_map( self , schema , inobjs , newdb ) : #NEWLINE# #INDENT# 'Initalize the dictionary of tables by converting the input map\n\n        :param schema: schema owning the tables\n        :param inobjs: YAML map defining the schema objects\n        :param newdb: collection of dictionaries defining the database\n        ' #NEWLINE# for key in inobjs : #NEWLINE# #INDENT# if ( not key . startswith ( 'foreign table ' ) ) : #NEWLINE# #INDENT# raise KeyError ( ( 'Unrecognized object type: %s' % key ) ) #NEWLINE# #UNINDENT# ftb = key [ 14 : ] #NEWLINE# self [ ( schema . name , ftb ) ] = ftable = ForeignTable ( schema = schema . name , name = ftb ) #NEWLINE# inftable = inobjs [ key ] #NEWLINE# if ( not inftable ) : #NEWLINE# #INDENT# raise ValueError ( ( "Foreign table '%s' has no specification" % ftb ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# newdb . columns . from_map ( inobjs , inftable [ 'columns' ] ) #NEWLINE# #UNINDENT# except KeyError as exc : #NEWLINE# #INDENT# exc . args = ( ( "Foreign table '%s' has no columns" % ftb ) , ) #NEWLINE# raise #NEWLINE# #UNINDENT# for attr in [ 'server' , 'options' , 'owner' , 'description' ] : #NEWLINE# #INDENT# if ( attr in inftable ) : #NEWLINE# #INDENT# setattr ( ftable , attr , inftable [ attr ] ) #NEWLINE# #UNINDENT# #UNINDENT# if ( 'privileges' in inftable ) : #NEWLINE# #INDENT# ftable . privileges = privileges_from_map ( inftable [ 'privileges' ] , ftable . allprivs , ftable . owner )