updates to the Console classes:

- added ErrConsole
- import console as namespace throughout the package
- swap out the static methods for instance methods.

Wrap the entry point in try/except.
Note, catching IncorrectPasswordError is currently not working. See https://github.com/Iapetus-11/aio-q3-rcon/issues/4
This commit is contained in:
2026-03-22 04:10:53 +00:00
parent 9a4fefcbbb
commit bfb45efb32
11 changed files with 64 additions and 46 deletions

View File

@@ -2,7 +2,7 @@ from aioq3rcon import Client
from clypi import Command, Positional, arg
from typing_extensions import override
from q3rcon_cli.console import Console
from q3rcon_cli import console
class Hostname(Command):
@@ -21,10 +21,10 @@ class Hostname(Command):
if not self.new_hostname:
async with Client(self.host, self.port, self.password) as client:
if response := await client.send_command('sv_hostname'):
Console.print_cvar(response)
console.out.print_cvar(response)
return
async with Client(self.host, self.port, self.password) as client:
await client.send_command(f'sv_hostname {self.new_hostname}')
if response := await client.send_command('sv_hostname'):
Console.print_cvar(response)
console.out.print_cvar(response)