mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
355 B
20 lines
355 B
# -*- coding: utf-8 -*-
|
|
#
|
|
|
|
import sys
|
|
|
|
|
|
class TeeObj:
|
|
origin_stdout = sys.stdout
|
|
|
|
def __init__(self, file_obj):
|
|
self.file_obj = file_obj
|
|
|
|
def write(self, msg):
|
|
self.origin_stdout.write(msg)
|
|
self.file_obj.write(msg.replace('*', ''))
|
|
|
|
def flush(self):
|
|
self.origin_stdout.flush()
|
|
self.file_obj.flush()
|