A context manager for preparing the source for blocks. It adds the character':', increases the indentation on enter and decreases the indentation on exit. If *extra* is given, it will be directly appended after the colon character.
(self, *, extra = None)
| 742 | |
| 743 | @contextmanager |
| 744 | def block(self, *, extra = None): |
| 745 | """A context manager for preparing the source for blocks. It adds |
| 746 | the character':', increases the indentation on enter and decreases |
| 747 | the indentation on exit. If *extra* is given, it will be directly |
| 748 | appended after the colon character. |
| 749 | """ |
| 750 | self.write(":") |
| 751 | if extra: |
| 752 | self.write(extra) |
| 753 | self._indent += 1 |
| 754 | yield |
| 755 | self._indent -= 1 |
| 756 | |
| 757 | @contextmanager |
| 758 | def delimit(self, start, end): |
no test coverage detected