#NEWLINE# def GET( self ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# preferences_json = self . _read_json_data_file ( 'preferences.json' ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# logging . warning ( 'Could not load preferences, using defaults' , exc_info = True ) #NEWLINE# preferences_json = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# preferences_json [ 'item-actions' ] = json . dumps ( { #NEWLINE# #INDENT# 'plusone-action' : True , #NEWLINE# 'share-action' : False , #NEWLINE# 'email-action' : False , #NEWLINE# 'tags-action' : True , #NEWLINE# #UNINDENT# } ) #NEWLINE# preferences_json [ 'show-oldest-interrupt' ] = 'false' #NEWLINE# preferences_json [ 'read-items-visible' ] = 'true' #NEWLINE# preferences_json [ 'start-page' ] = 'home' #NEWLINE# preferences_json [ 'show-scroll-help' ] = 'false' #NEWLINE# preferences_json [ 'show-search-clarification' ] = 'false' #NEWLINE# preferences_json [ 'show-blogger-following-intro' ] = 'false' #NEWLINE# if ( 'lhn-prefs' in preferences_json ) : #NEWLINE# #INDENT# lhn_prefs = json . loads ( preferences_json [ 'lhn-prefs' ] ) #NEWLINE# for section_json in lhn_prefs . values ( ) : #NEWLINE# #INDENT# section_json [ 'suc' ] = 'true' #NEWLINE# #UNINDENT# if ( 'recommendations' in lhn_prefs ) : #NEWLINE# #INDENT# lhn_prefs [ 'recommendations' ] [ 'ism' ] = 'true' #NEWLINE# #UNINDENT# preferences_json [ 'lhn-prefs' ] = json . dumps ( lhn_prefs ) #NEWLINE# #UNINDENT# return json . dumps ( { #NEWLINE# #INDENT# 'prefs' : [ { #NEWLINE# #INDENT# 'id' : id , #NEWLINE# 'value' : value , #NEWLINE# #UNINDENT# } for ( id , value ) in preferences_json . iteritems ( ) ] , #NEWLINE# #UNINDENT# } )