#NEWLINE# def _update_state( self , response ) : #NEWLINE# #INDENT# "Update the state of the browser. Create a new state object, and\n        append to or overwrite the browser's state history.\n\n        :param requests.MockResponse: New response object\n\n        " #NEWLINE# self . _states = self . _states [ : ( self . _cursor + 1 ) ] #NEWLINE# state = RoboState ( self , response ) #NEWLINE# self . _states . append ( state ) #NEWLINE# self . _cursor += 1 #NEWLINE# if self . _maxlen : #NEWLINE# #INDENT# decrement = ( len ( self . _states ) - self . _maxlen ) #NEWLINE# if ( decrement > 0 ) : #NEWLINE# #INDENT# self . _states = self . _states [ decrement : ] #NEWLINE# self . _cursor -= decrement