Show More
@@ -26,12 +26,21 b" PTK3 = ptk_version.startswith('3.')" | |||
|
26 | 26 | class TerminalPdb(Pdb): |
|
27 | 27 | """Standalone IPython debugger.""" |
|
28 | 28 | |
|
29 | def __init__(self, *args, **kwargs): | |
|
29 | def __init__(self, *args, pt_session_options=None, **kwargs): | |
|
30 | 30 | Pdb.__init__(self, *args, **kwargs) |
|
31 | 31 | self._ptcomp = None |
|
32 | self.pt_init() | |
|
33 | ||
|
34 | def pt_init(self): | |
|
32 | self.pt_init(pt_session_options) | |
|
33 | ||
|
34 | def pt_init(self, pt_session_options=None): | |
|
35 | """Initialize the prompt session and the prompt loop | |
|
36 | and store them in self.pt_app and self.pt_loop. | |
|
37 | ||
|
38 | Additional keyword arguments for the PromptSession class | |
|
39 | can be specified in pt_session_options. | |
|
40 | """ | |
|
41 | if pt_session_options is None: | |
|
42 | pt_session_options = {} | |
|
43 | ||
|
35 | 44 | def get_prompt_tokens(): |
|
36 | 45 | return [(Token.Prompt, self.prompt)] |
|
37 | 46 | |
@@ -68,6 +77,7 b' class TerminalPdb(Pdb):' | |||
|
68 | 77 | |
|
69 | 78 | if not PTK3: |
|
70 | 79 | options['inputhook'] = self.shell.inputhook |
|
80 | options.update(pt_session_options) | |
|
71 | 81 | self.pt_loop = asyncio.new_event_loop() |
|
72 | 82 | self.pt_app = PromptSession(**options) |
|
73 | 83 |
General Comments 0
You need to be logged in to leave comments.
Login now