mirror of
https://github.com/onyx-and-iris/q3rcon-tui.git
synced 2026-02-26 03:09:09 +00:00
move guard clause out of context block
This commit is contained in:
parent
3181377c18
commit
97458682ea
@ -51,14 +51,15 @@ class RconApp(App):
|
|||||||
if not settings.append:
|
if not settings.append:
|
||||||
self.query_one('#response', RichLog).clear()
|
self.query_one('#response', RichLog).clear()
|
||||||
|
|
||||||
|
cmd = self.query_one('#command', Input).value.strip()
|
||||||
|
if not cmd:
|
||||||
|
self.app.bell()
|
||||||
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
async with Client(
|
async with Client(
|
||||||
settings.host, settings.port, settings.password
|
settings.host, settings.port, settings.password
|
||||||
) as client:
|
) as client:
|
||||||
cmd = self.query_one('#command', Input).value.strip()
|
|
||||||
if not cmd:
|
|
||||||
self.app.bell()
|
|
||||||
return
|
|
||||||
response = await client.send_command(cmd)
|
response = await client.send_command(cmd)
|
||||||
self.query_one('#response', RichLog).write(
|
self.query_one('#response', RichLog).write(
|
||||||
self.writable.parse(cmd, response)
|
self.writable.parse(cmd, response)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user