remotelogin/connections/terminal/__init__.py
def record(
        self,
        timeout=None,
        record_stop_signal=None,
        output_stream=None,
        time_to_sleep_between_recv=None,
        silent=False,
    ):
        """ records the data received from the terminal to an output_stream
            useful for recording files that change overtime in a tail or to capture log messages

        Args:
            timeout (float): time to record (if given)
            record_stop_signal (threading.Event): event object signaling when to stop
            output_stream (io._IOBase): a stream sink where to send the data to
            time_to_sleep_between_recv (float):
            silent (bool): whether to send data to the stream sink. If set to True no recording will happen

        Returns:

        """

        time_to_sleep_between_recv = (
            time_to_sleep_between_recv or self.sleep_time_after_no_data
        )
        timer = fdutils.timer.get_timer_from_timeout(timeout)

        stream = None if silent else (output_stream or StringIO())

        while not (
            timer.has_expired
            or self.stop_signal.is_set()
            or record_stop_signal
            and record_stop_signal.is_set()
        ):

            recv = self.recv()

            if recv == 0:
                self.close()
                log.error(
                    "recv command return empty string. End side might have been closed!"
                )
                raise ConnectionError

            elif recv != constants.SOCKET_RECV_NOT_READY and not silent:
                stream.write(recv)

            else:
                time.sleep(time_to_sleep_between_recv)

        return stream
 records the data received from the terminal to an output_stream
            useful for recording files that change overtime in a tail or to capture log messages

        Args:
            timeout (float): time to record (if given)
            record_stop_signal (threading.Event): event object signaling when to stop
            output_stream (io._IOBase): a stream sink where to send the data to
            time_to_sleep_between_recv (float):
            silent (bool): whether to send data to the stream sink. If set to True no recording will happen

        Returns:

        
records the data received from the terminal to an output_stream
useful for recording files that change overtime in a tail or to capture log messages
records the data received from the terminal to an output_stream useful for recording files that change overtime in a tail or to capture log messages
def record(
        self,
        timeout=None,
        record_stop_signal=None,
        output_stream=None,
        time_to_sleep_between_recv=None,
        silent=False,
    ):
        time_to_sleep_between_recv = (
            time_to_sleep_between_recv or self.sleep_time_after_no_data
        )
        timer = fdutils.timer.get_timer_from_timeout(timeout)
        stream = None if silent else (output_stream or StringIO())
        while not (
            timer.has_expired
            or self.stop_signal.is_set()
            or record_stop_signal
            and record_stop_signal.is_set()
        ):
            recv = self.recv()
            if recv == 0:
                self.close()
                log.error(
                    "recv command return empty string. End side might have been closed!"
                )
                raise ConnectionError
            elif recv != constants.SOCKET_RECV_NOT_READY and not silent:
                stream.write(recv)
            else:
                time.sleep(time_to_sleep_between_recv)
        return stream
def record ( self , timeout = None , record_stop_signal = None , output_stream = None , time_to_sleep_between_recv = None , silent = False , ) : time_to_sleep_between_recv = ( time_to_sleep_between_recv or self . sleep_time_after_no_data ) timer = fdutils . timer . get_timer_from_timeout ( timeout ) stream = None if silent else ( output_stream or StringIO ( ) ) while not ( timer . has_expired or self . stop_signal . is_set ( ) or record_stop_signal and record_stop_signal . is_set ( ) ) : recv = self . recv ( ) if recv == 0 : self . close ( ) log . error ( "recv command return empty string. End side might have been closed!" ) raise ConnectionError elif recv != constants . SOCKET_RECV_NOT_READY and not silent : stream . write ( recv ) else : time . sleep ( time_to_sleep_between_recv ) return stream
records the data received from the terminal to an output_stream
useful for recording files that change overtime in a tail or to capture log messages
records the data received from the terminal to an output_stream useful for recording files that change overtime in a tail or to capture log messages
""" records the data received from the terminal to an output_stream
            useful for recording files that change overtime in a tail or to capture log messages

        Args:
            timeout (float): time to record (if given)
            record_stop_signal (threading.Event): event object signaling when to stop
            output_stream (io._IOBase): a stream sink where to send the data to
            time_to_sleep_between_recv (float):
            silent (bool): whether to send data to the stream sink. If set to True no recording will happen

        Returns:

        """
None
self
timeout
time to record (if given)
time to record ( if given )
record_stop_signal
event object signaling when to stop
event object signaling when to stop
output_stream
a stream sink where to send the data to
a stream sink where to send the data to
time_to_sleep_between_recv
None
silent
whether to send data to the stream sink. If set to True no recording will happen
whether to send data to the stream sink . If set to True no recording will happen