aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2021-06-07 16:06:27 -0400
committerJohn Snow <jsnow@redhat.com>2021-06-18 16:10:07 -0400
commit1caa505766dbf7bd233b088e82bd7a745d2ba325 (patch)
treec86c66889d995ed65c83038aa7f89f5994e770bb /scripts
parent2ac3f3786e09c2ad40da16fa4ff4b0f99200f72e (diff)
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: John Snow <jsnow@redhat.com> Message-id: 20210607200649.1840382-21-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/qmp/qmp-shell9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell
index cfcefb95f9..3b86ef7d88 100755
--- a/scripts/qmp/qmp-shell
+++ b/scripts/qmp/qmp-shell
@@ -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()