mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-09-06 18:05:37 +00:00
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>
This commit is contained in:
parent
2ac3f3786e
commit
1caa505766
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue