Transform a system assignment found by the ``find()`` classmethod.
(self, lines: List[str])
| 263 | ix += 1 |
| 264 | |
| 265 | def transform(self, lines: List[str]): |
| 266 | """Transform a system assignment found by the ``find()`` classmethod. |
| 267 | """ |
| 268 | start_line, start_col = self.start_line, self.start_col |
| 269 | |
| 270 | lhs = lines[start_line][:start_col] |
| 271 | end_line = find_end_of_continued_line(lines, start_line) |
| 272 | rhs = assemble_continued_line(lines, (start_line, start_col), end_line) |
| 273 | assert rhs.startswith('!'), rhs |
| 274 | cmd = rhs[1:] |
| 275 | |
| 276 | lines_before = lines[:start_line] |
| 277 | call = "get_ipython().getoutput({!r})".format(cmd) |
| 278 | new_line = lhs + call + '\n' |
| 279 | lines_after = lines[end_line + 1:] |
| 280 | |
| 281 | return lines_before + [new_line] + lines_after |
| 282 | |
| 283 | # The escape sequences that define the syntax transformations IPython will |
| 284 | # apply to user input. These can NOT be just changed here: many regular |
nothing calls this directly
no test coverage detected