Writes output to selected output stream.
(self, text_message)
| 1609 | self.file = None |
| 1610 | |
| 1611 | def write(self, text_message): |
| 1612 | |
| 1613 | """ Writes output to selected output stream. """ |
| 1614 | |
| 1615 | if self.writer: |
| 1616 | if self.mode == "file": |
| 1617 | try: |
| 1618 | escape_ansi_color_codes = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])') |
| 1619 | text_message = escape_ansi_color_codes.sub('', text_message) |
| 1620 | except: |
| 1621 | pass |
| 1622 | self.writer.write(text_message+"\n") |
| 1623 | |
| 1624 | def close(self): |
| 1625 |
no outgoing calls