def format_te_prefs(prefs_dict):
 sample_coloring = prefs_dict['sample_coloring']
 lines = []
 for k in sample_coloring:
  for t in sample_coloring[k]['colors']:
   if isinstance(t, tuple):
    lines.append((''.join([(str(i) + ',') for i in t[1]]) + '\n'))
   if isinstance(t, str):
    lines.append((((t + ':') + ''.join([(str(i) + ',') for i in data_color_hsv[sample_coloring[k]['colors'][t]]])) + '\n'))
  lines.append((((('>default' + k) + ':') + k) + '\n'))
 return lines

def format_te_prefs ( prefs_dict ) : sample_coloring = prefs_dict [ 'sample_coloring' ] lines = [ ] for k in sample_coloring : for t in sample_coloring [ k ] [ 'colors' ] : if isinstance ( t , tuple ) : lines . append ( ( '' . join ( [ ( str ( i ) + ',' ) for i in t [ 1 ] ] ) + '\n' ) ) if isinstance ( t , str ) : lines . append ( ( ( ( t + ':' ) + '' . join ( [ ( str ( i ) + ',' ) for i in data_color_hsv [ sample_coloring [ k ] [ 'colors' ] [ t ] ] ] ) ) + '\n' ) ) lines . append ( ( ( ( ( '>default' + k ) + ':' ) + k ) + '\n' ) ) return lines
format a preferences file for use with topiaryexplorer tep file .