def name_yaml_formatter(table_dict):
 table_string = 'name: {\n'
 namerecord_list = table_dict['names']
 for record in namerecord_list:
  if (record.__dict__['langID'] == 0):
   record_name = str(record.__dict__['nameID'])
  else:
   record_name = (str(record.__dict__['nameID']) + 'u')
  record_field = (((' ' * 4) + 'nameID') + record_name)
  table_string = ((((table_string + record_field) + ': ') + str(record.__dict__)) + ',\n')
 table_string = (table_string + '}\n\n')
 return table_string

def name_yaml_formatter ( table_dict ) : table_string = 'name: {\n' namerecord_list = table_dict [ 'names' ] for record in namerecord_list : if ( record . __dict__ [ 'langID' ] == 0 ) : record_name = str ( record . __dict__ [ 'nameID' ] ) else : record_name = ( str ( record . __dict__ [ 'nameID' ] ) + 'u' ) record_field = ( ( ( ' ' * 4 ) + 'nameID' ) + record_name ) table_string = ( ( ( ( table_string + record_field ) + ': ' ) + str ( record . __dict__ ) ) + ',\n' ) table_string = ( table_string + '}\n\n' ) return table_string
formats the yaml table string for opentype name tables .