(prompt: str)
| 30 | called = set() |
| 31 | |
| 32 | def input_(prompt: str) -> str: |
| 33 | if prompt in called: |
| 34 | raise AssertionError( |
| 35 | 'answer for %r missing and no default present' % prompt |
| 36 | ) |
| 37 | called.add(prompt) |
| 38 | for question, answer in answers.items(): |
| 39 | if prompt.startswith(qs.PROMPT_PREFIX + question): |
| 40 | return answer |
| 41 | if needanswer: |
| 42 | raise AssertionError('answer for %r missing' % prompt) |
| 43 | return '' |
| 44 | |
| 45 | return input_ |
| 46 |