#NEWLINE# def _on_get_buf( self , data ) : #NEWLINE# #INDENT# buf_id = data [ 'id' ] #NEWLINE# buf = self . bufs . get ( buf_id ) #NEWLINE# if ( not buf ) : #NEWLINE# #INDENT# return msg . warn ( 'no buf found: ' , data , ". Hopefully you didn't need that." ) #NEWLINE# #UNINDENT# timeout_id = buf . get ( 'timeout_id' ) #NEWLINE# if timeout_id : #NEWLINE# #INDENT# utils . cancel_timeout ( timeout_id ) #NEWLINE# #UNINDENT# if ( data [ 'encoding' ] == 'base64' ) : #NEWLINE# #INDENT# data [ 'buf' ] = base64 . b64decode ( data [ 'buf' ] ) #NEWLINE# #UNINDENT# self . bufs [ buf_id ] = data #NEWLINE# save = False #NEWLINE# if ( buf_id in self . save_on_get_bufs ) : #NEWLINE# #INDENT# self . save_on_get_bufs . remove ( buf_id ) #NEWLINE# save = True #NEWLINE# #UNINDENT# view = self . get_view ( buf_id ) #NEWLINE# if ( not view ) : #NEWLINE# #INDENT# msg . debug ( 'No view for buf ' , buf_id , '. Saving to disk.' ) #NEWLINE# return utils . save_buf ( data ) #NEWLINE# #UNINDENT# view . update ( data ) #NEWLINE# if save : #NEWLINE# #INDENT# view . save ( )