(self, completer)
| 3216 | |
| 3217 | @contextmanager |
| 3218 | def readline_completion(self, completer): |
| 3219 | try: |
| 3220 | import readline |
| 3221 | except ImportError: |
| 3222 | yield |
| 3223 | return |
| 3224 | |
| 3225 | old_completer = readline.get_completer() |
| 3226 | try: |
| 3227 | readline.set_completer(completer) |
| 3228 | if readline.backend == "editline": |
| 3229 | # libedit uses "^I" instead of "tab" |
| 3230 | command_string = "bind ^I rl_complete" |
| 3231 | else: |
| 3232 | command_string = "tab: complete" |
| 3233 | readline.parse_and_bind(command_string) |
| 3234 | yield |
| 3235 | finally: |
| 3236 | readline.set_completer(old_completer) |
| 3237 | |
| 3238 | @contextmanager |
| 3239 | def _sigint_handler(self): |
no test coverage detected