#NEWLINE# def GET( self ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# stream_preferences_json = self . _read_json_data_file ( 'stream-preferences.json' ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# logging . warning ( 'Could not load stream preferences, using defaults' , exc_info = True ) #NEWLINE# stream_preferences_json = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# return json . dumps ( { #NEWLINE# #INDENT# 'streamprefs' : { stream_id : [ { #NEWLINE# #INDENT# 'id' : id , #NEWLINE# 'value' : value , #NEWLINE# #UNINDENT# } for ( id , value ) in prefs . iteritems ( ) ] for ( stream_id , prefs ) in stream_preferences_json . iteritems ( ) } , #NEWLINE# #UNINDENT# } )