'Write string line as one or more folded lines'

def _unfoldLDIFLine(self, line):

    line_len = len(line)
    if (line_len <= self._cols):
        self._output_file.write(line)
        self._output_file.write(self._line_sep)
    else:
        pos = self._cols
        self._output_file.write(line[0:min(line_len, self._cols)])
        self._output_file.write(self._line_sep)
        while (pos < line_len):
            self._output_file.write('    ')
            self._output_file.write(line[pos:min(line_len, ((pos + self._cols) - 1))])
            self._output_file.write(self._line_sep)
            pos = ((pos + self._cols) - 1)
    return
