Return text between first and last with prompts added.
(self, first, last)
| 986 | return idleConf.GetExtensions(shell_only=True) |
| 987 | |
| 988 | def get_prompt_text(self, first, last): |
| 989 | """Return text between first and last with prompts added.""" |
| 990 | text = self.text.get(first, last) |
| 991 | lineno_range = range( |
| 992 | int(float(first)), |
| 993 | int(float(last)) |
| 994 | ) |
| 995 | prompts = [ |
| 996 | self.shell_sidebar.line_prompts.get(lineno) |
| 997 | for lineno in lineno_range |
| 998 | ] |
| 999 | return "\n".join( |
| 1000 | line if prompt is None else f"{prompt} {line}" |
| 1001 | for prompt, line in zip(prompts, text.splitlines()) |
| 1002 | ) + "\n" |
| 1003 | |
| 1004 | |
| 1005 | def copy_with_prompts_callback(self, event=None): |
no test coverage detected