#NEWLINE# def schema_print( schema_location , prefix ) : #NEWLINE# #INDENT# prefix = prefix . upper ( ) #NEWLINE# json = ovs . json . from_file ( schema_location ) #NEWLINE# schema = ovs . db . schema . DbSchema . from_json ( json ) #NEWLINE# print ( '# Do NOT edit.' ) #NEWLINE# print ( '# This is automatically generated.' ) #NEWLINE# print ( ( '# created based on version %s' % ( schema . version or 'unknown' ) ) ) #NEWLINE# print ( '' ) #NEWLINE# print ( '' ) #NEWLINE# print ( ( "%s_DB_NAME = '%s'" % ( prefix , schema . name ) ) ) #NEWLINE# for table in sorted ( schema . tables . values ( ) , key = operator . attrgetter ( 'name' ) ) : #NEWLINE# #INDENT# print ( '' ) #NEWLINE# print ( ( "%s_TABLE_%s = '%s'" % ( column , table . name . upper ( ) , table . name ) ) ) #NEWLINE# for column in sorted ( table . columns . values ( ) , key = operator . attrgetter ( 'name' ) ) : #NEWLINE# #INDENT# print ( ( "%s_%s_COL_%s = '%s'" % ( prefix , table . name . upper ( ) , column . name . upper ( ) , column . name ) ) )