Skip to content
Snippets Groups Projects
Commit 1caa5057 authored by John Snow's avatar John Snow
Browse files

scripts/qmp-shell: move get_prompt() to prompt property


Small tidying; treat "prompt" like an immutable property instead of
function/method/routine.

Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
Message-id: 20210607200649.1840382-21-jsnow@redhat.com
Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
parent 2ac3f378
No related branches found
No related tags found
No related merge requests found
......@@ -292,10 +292,11 @@ class QMPShell(qmp.QEMUMonitorProtocol):
version = self._greeting['QMP']['version']['qemu']
print("Connected to QEMU {major}.{minor}.{micro}\n".format(**version))
def get_prompt(self):
@property
def prompt(self):
if self._transmode:
return "TRANS> "
return "(QEMU) "
return 'TRANS> '
return '(QEMU) '
def read_exec_command(self, prompt):
"""
......@@ -435,7 +436,7 @@ def main():
die(f"Couldn't connect to {args.qmp_server}: {err!s}")
qemu.show_banner()
while qemu.read_exec_command(qemu.get_prompt()):
while qemu.read_exec_command(qemu.prompt):
pass
qemu.close()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment