Formats and writes a line to the output
502053
def write_line(self, line=None, *args, **kwargs):
        
        if line is None:
            # Empty line
            self.write("\n")
        else:
            # Format the line, if arguments have been given
            if args or kwargs:
                line = line.format(*args, **kwargs)

            with self.__lock:
                # Write it
                self.write(line)
                try:
                    if line[-1] != "\n":
                        # Add the trailing new line
                        self.write("\n")
                except IndexError:
                    # Got an empty string
                    self.write("\n")

        self.flush()
474886
def output_line(gandi, key, val, justify):
    
    msg = ('%%-%ds:%%s' % justify) % (key, (' %s' % val) if val else '')
    gandi.echo(msg)
760631
def formatLine(self, line, indent=0, outcome_char=''):
        
        actual_spaces = (indent * self.indent_spaces) - len(outcome_char)
        return (outcome_char + ' ' * actual_spaces + line)
1289468
def writeline(self, line, line_number):
        
        tmp_file = tempfile.TemporaryFile('w+')
        if not line.endswith(os.linesep):

            line += os.linesep
        try:

            with open(self.path, 'r') as file_handle:

                for count, new_line in enumerate(file_handle):

                    if count == line_number:

                        new_line = line

                    tmp_file.write(new_line)

            tmp_file.seek(0)
            with open(self.path, 'w') as file_handle:

                for new_line in tmp_file:

                    file_handle.write(new_line)
        finally:

            tmp_file.close()
154707
public function outputPlaintext()
    {
        echo str_repeat('=', 100) . "\n";
        echo $this->_backtrace[0]['file'] . ':' . $this->_backtrace[1]['function'] . ':' . $this->_backtrace[0]['line'] . "\n";
        echo str_repeat('-', 100) . "\n";
        echo self::dump($this->_var, $this->_depth, false);
        echo str_repeat('=', 100) . "\n";
    }
863364
def _write_line(self, text=''):
        
        if text:
            self._code += str(text) + "\n"
        else:
            self._code += "\n"
1131526
def string_format(data, out, opts=None, **kwargs):
    '''
    
    '''
    raw_output = try_printout(data, out, opts, **kwargs)
    ansi_escape = re.compile(r'\x1b[^m]*m')
    return ansi_escape.sub('', raw_output)
1342105
def PrintSeparatorLine(self):
    """"""
    self._output_writer.Write('-' * self._LINE_LENGTH)
    self._output_writer.Write('\n')
1180294
def write(self, text):
        '''  '''
        # Output is converted to bytes with Windows-style line endings.
        if sys.version_info[0] == 2:
            text_bytes = str(text.upper() + '\r\n').encode('utf-8')
        else:
            text_bytes = bytes(text.upper() + '\r\n', 'utf-8')
        self.ser.write(text_bytes)
58316
def write_txt(self, as_string=False):
        """"""
        if not as_string:
            with open('{}/{}.txt'.format(self.outpath, self.outputprefix), 'w') as f:
                [f.write(textline + '\n') for textline in self.txtreport]
        else:
            output = '\n'.join(self.txtreport)
            if config.RAWSTRING:
                output = repr(output)
            print(output)
432891
def write(self, fileobj = sys.stdout, indent = u""):
		
		fileobj.write(self.start_tag(indent))
		fileobj.write(u"\n")
1345053
def write(self, data):
        '''  '''
        if data == '\n':  # print does this
            return self.stream.write(data)
        else:
            bytes_ = 0
            for line in data.splitlines(True):
                nl = ''
                if line.endswith('\n'):  # mv nl to end:
                    line = line[:-1]
                    nl = '\n'
                bytes_ += self.stream.write(
                                f'{self.start}{line}{self.default}{nl}'
                          ) or 0  # in case None returned (on Windows)
            return bytes_
693277
def out(*output, **kwargs):
    
    output = ' '.join([str(o) for o in output])
    if kwargs.get('wrap') is not False:
        output = '\n'.join(wrap(output, kwargs.get('indent', '')))
    elif kwargs.get('indent'):
        indent = kwargs['indent']
        output = indent + ('\n' + indent).join(output.splitlines())
    sys.stdout.write(output + '\n')
1344141
def send_output(self, value, stdout):
        

        writer = self.writer

        if value is not None:
            writer.write('{!r}\n'.format(value).encode('utf8'))

        if stdout:
            writer.write(stdout.encode('utf8'))

        yield from writer.drain()
1221591
def writeline(self, fmt, *args):
        
        fmt = self.endian + fmt
        size = struct.calcsize(fmt)

        fix = struct.pack(self.endian + 'i', size)
        line = struct.pack(fmt, *args)

        self.write(fix)
        self.write(line)
        self.write(fix)
1374974
def writeln (self, msg):
        """"""
        self.fd.write(u"%s%s" % (msg, unicode(os.linesep)))
453467
def writelines(self, lines, level=0):
        """"""
        for line in lines:
            for line in line.rstrip(u'\n').split(u'\n'):
                self.write(line.rstrip(u'\n'), level=level)