Example #1
0
 def _handle_load_history_request(self, details):
     """Populate recorder history from a file"""
     recorder.load_actions(
         action_file=details["payload"]["filename"],
         map_key_to_state=IStateManager.get_state_manager_by_key,
         slc=self._slice_from_paylaod(details),
     )
Example #2
0
    def _handle_replay_actions_request(self, details):
        """Replay all or range of actions stored by the recorder"""
        recorder.get_action_details()
        replay_t = threading.Thread(
            target=recorder.replay_range,
            kwargs={"slc": self._slice_from_paylaod(details)},
            name="[>] replay",
        )

        replay_t.daemon = True
        replay_t.start()
Example #3
0
 def _handle_list_actions_request(self, details):
     """Retrieve recorded acitons and send back to the client"""
     self._write_data(
         details["client"],
         ServerToClientRequests.action_list,
         {"actions": recorder.get_action_details(self._slice_from_paylaod(details))},
     )
Example #4
0
 def _handle_save_history_reqeust(self, details):
     """Save recorder history to a file"""
     recorder.save_actions(
         action_file=details["payload"]["filename"],
         slc=self._slice_from_paylaod(details),
     )
Example #5
0
 def _handle_purge_actions_request(self, details):
     """Clear recorded actions"""
     recorder.erase_range(self._slice_from_paylaod(details))