Return a copy of the source object with all lines indented by the given indent-string.
(self, indent: str = " " * 4)
| 85 | return source |
| 86 | |
| 87 | def indent(self, indent: str = " " * 4) -> Source: |
| 88 | """Return a copy of the source object with all lines indented by the |
| 89 | given indent-string.""" |
| 90 | newsource = Source() |
| 91 | newsource.raw_lines = self.raw_lines |
| 92 | newsource.lines = [(indent + line) for line in self.lines] |
| 93 | return newsource |
| 94 | |
| 95 | def getstatement(self, lineno: int) -> Source: |
| 96 | """Return Source statement which contains the given linenumber |