示例#1
0
文件: common.py 项目: NaTsUk0/Ajatar
def dataToStdout(data, forceOutput=False, bold=False, content_type=None):
    #处理输出到命令行

    if isinstance(data, str):
        message = stdoutencode(data)
    else:
        message = data
    sys.stdout.write(setColor(message.decode(), bold))
    try:
        sys.stdout.flush()
    except IOError:
        pass
示例#2
0
文件: common.py 项目: zsdlove/w9scan
def dataToStdout(data, forceOutput=False, bold=False, content_type=None):
    """
    Writes text to the stdout (console) stream
    """
    if isinstance(data, unicode):
        message = stdoutencode(data)
    else:
        message = data
    sys.stdout.write(setColor(message, bold))
    try:
        sys.stdout.flush()
    except IOError:
        pass
示例#3
0
文件: ansistrm.py 项目: m1cr0n/sqlmap
    def emit(self, record):
        try:
            message = stdoutencode(self.format(record))
            stream = self.stream

            if not self.is_tty:
                stream.write(message)
            else:
                self.output_colorized(message)
            stream.write(getattr(self, 'terminator', '\n'))

            self.flush()
        except (KeyboardInterrupt, SystemExit):
            raise
        except:
            self.handleError(record)
示例#4
0
文件: common.py 项目: zer0yu/ZEROScan
def dataToStdout(data, bold=False):
    """
    Writes text to the stdout (console) stream
    """

    message = ""

    if isinstance(data, unicode):
        message = stdoutencode(data)
    else:
        message = data

    sys.stdout.write(setColor(message, bold))

    try:
        sys.stdout.flush()
    except IOError:
        pass
示例#5
0
    def emit(self, record):
        try:
            message = stdoutencode(self.format(record))
            stream = self.stream

            if not self.is_tty:
                if message and message[0] == "\r":
                    message = message[1:]
                stream.write(message)
            else:
                self.output_colorized(message)
            stream.write(getattr(self, 'terminator', '\n'))

            self.flush()
        except (KeyboardInterrupt, SystemExit):
            raise
        except:
            self.handleError(record)
示例#6
0
def dataToStdout(data, bold=False):
    """
    Writes text to the stdout (console) stream
    """
    if conf['SCREEN_OUTPUT']:
        message = ""

        if isinstance(data, unicode):
            message = stdoutencode(data)
        else:
            message = data

        sys.stdout.write(setColor(message, bold))

        try:
            sys.stdout.flush()
        except IOError:
            pass
    return
示例#7
0
文件: common.py 项目: Tr33-He11/Sepia
def dataToStdout(data, bold=False):
    """
    Writes text to the stdout (console) stream
    """
    logging._acquireLock()
    if isinstance(data, unicode):
        message = stdoutencode(data)
    else:
        message = data

    sys.stdout.write(setColor(message, bold))

    try:
        sys.stdout.flush()
    except IOError:
        pass

    logging._releaseLock()
    return
示例#8
0
def dataToStdout(data, bold=False):
    """
    Writes text to the stdout (console) stream
    """
    if 'quiet' not in conf or not conf.quiet:
        message = ""

        if isinstance(data, unicode):
            message = stdoutencode(data)
        else:
            message = data

        sys.stdout.write(setColor(message, bold))

        try:
            sys.stdout.flush()
        except IOError:
            pass
    return
示例#9
0
def dataToStdout(data, bold=False):
    """
    Writes text to the stdout (console) stream
    """
    if conf.SCREEN_OUTPUT:
        if conf.ENGINE is ENGINE_MODE_STATUS.THREAD:
            logging._acquireLock()

        if isinstance(data, str):
            message = stdoutencode(data)
        else:
            message = data

        sys.stdout.write(setColor(message.decode('utf8'), bold))
        try:
            sys.stdout.flush()
        except IOError:
            pass

        if conf.ENGINE is ENGINE_MODE_STATUS.THREAD:
            logging._releaseLock()
    return
示例#10
0
文件: common.py 项目: PurpleHua/POC-T
def dataToStdout(data, bold=False):
    """
    Writes text to the stdout (console) stream
    """
    if conf.SCREEN_OUTPUT:
        if conf.ENGINE is ENGINE_MODE_STATUS.THREAD:
            logging._acquireLock()

        if isinstance(data, unicode):
            message = stdoutencode(data)
        else:
            message = data

        sys.stdout.write(setColor(message, bold))

        try:
            sys.stdout.flush()
        except IOError:
            pass

        if conf.ENGINE is ENGINE_MODE_STATUS.THREAD:
            logging._releaseLock()
    return
示例#11
0
 def emit(self, record):
     message = stdoutencode(FORMATTER.format(record))
     print >>LOGGER_OUTPUT, message.strip('\r')