| 2089 | |
| 2090 | _GoInteractive = object() |
| 2091 | def __call__(self, request=_GoInteractive): |
| 2092 | if request is not self._GoInteractive: |
| 2093 | try: |
| 2094 | self.help(request) |
| 2095 | except ImportError as e: |
| 2096 | self.output.write(f'{e}\n') |
| 2097 | else: |
| 2098 | self.intro() |
| 2099 | self.interact() |
| 2100 | self.output.write(''' |
| 2101 | You are now leaving help and returning to the Python interpreter. |
| 2102 | If you want to ask for help on a particular object directly from the |
| 2103 | interpreter, you can type "help(object)". Executing "help('string')" |
| 2104 | has the same effect as typing a particular string at the help> prompt. |
| 2105 | ''') |
| 2106 | |
| 2107 | def interact(self): |
| 2108 | self.output.write('\n') |