(self)
| 43 | self.cli_context.echo(self.cli_context.OK) |
| 44 | |
| 45 | def reconnect(self): |
| 46 | if self.connection: |
| 47 | self.connection.close() |
| 48 | else: |
| 49 | self.connection = self.cli_context.app.connection() |
| 50 | |
| 51 | self.cli_context.echo(f'-> connecting to {self.connection.as_uri()}.') |
| 52 | try: |
| 53 | self.connection.connect() |
| 54 | except (ConnectionRefusedError, ConnectionResetError) as e: |
| 55 | self.echo_error(e) |
| 56 | else: |
| 57 | self.cli_context.secho('-> connected.', fg='green', bold=True) |
| 58 | self.channel = self.connection.default_channel |
| 59 | |
| 60 | |
| 61 | @click.group(invoke_without_command=True) |
no test coverage detected