コード例 #1
0
ファイル: genericunix.py プロジェクト: ranjitkumar2k10/moler
 def _strip_new_lines_chars(self, line):
     """
     Method to delete new line chars and other chars we don not need to parse in on_new_line (color escape character)
     :param line: Line with special chars, raw string from device
     :return: line without special chars.
     """
     line = super(GenericUnixCommand, self)._strip_new_lines_chars(line)
     if self.remove_colors_from_terminal_output:
         line = remove_escape_codes(line)
     return line
コード例 #2
0
ファイル: genericunix.py プロジェクト: rosekdrd/moler
    def _decode_line(self, line):
        """
        Method to delete new line chars and other chars we don not need to parse in on_new_line (color escape character)

        :param line: Line with special chars, raw string from device
        :return: line without special chars.
        """
        if self.remove_colors_from_terminal_output:
            line = remove_escape_codes(line)
        return line
コード例 #3
0
 def _strip_new_lines_chars(self, line):
     line = super(GenericUnixCommand, self)._strip_new_lines_chars(line)
     if self.remove_colors_from_terminal_output:
         line = remove_escape_codes(line)
     return line
コード例 #4
0
ファイル: test_helpers.py プロジェクト: nokia/moler
def test_escape_cursors():
    from moler.helpers import remove_escape_codes
    raw_line = "\x1B7\x1B[0;100r\x1B8\x1B[1A\x1B[Jmoler_bash#"
    expected_line = "moler_bash#"
    line = remove_escape_codes(raw_line)
    assert expected_line == line