#NEWLINE# def _update_per_namespace( ) : #NEWLINE# #INDENT# 'Do a bunch of periodic stuff for a user.' #NEWLINE# for acc in account . Account . query ( ) . iter ( ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# acc . refresh_devices ( ) #NEWLINE# acc . put ( ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# logging . error ( 'Error refreshing account %s' , acc . key . string_id ( ) , exc_info = sys . exc_info ( ) ) #NEWLINE# #UNINDENT# #UNINDENT# for _room in room . Room . query ( ) . iter ( ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# _room . update_lights ( ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# logging . error ( 'Error updating room %s' , acc . name , exc_info = sys . exc_info ( ) )