Store one or more lines of input. If input lines are not newline-terminated, a newline is automatically appended.
(self, lines, buffer=None, store='source')
| 512 | indent_spaces = property(get_indent_spaces) |
| 513 | |
| 514 | def _store(self, lines, buffer=None, store='source'): |
| 515 | """Store one or more lines of input. |
| 516 | |
| 517 | If input lines are not newline-terminated, a newline is automatically |
| 518 | appended.""" |
| 519 | |
| 520 | if buffer is None: |
| 521 | buffer = self._buffer |
| 522 | |
| 523 | if lines.endswith('\n'): |
| 524 | buffer.append(lines) |
| 525 | else: |
| 526 | buffer.append(lines+'\n') |
| 527 | setattr(self, store, self._set_source(buffer)) |
| 528 | |
| 529 | def _set_source(self, buffer): |
| 530 | return u''.join(buffer) |