[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 51/72] scripts/qmp-shell: remove prompt argument from read_exec_co
From: |
John Snow |
Subject: |
[PULL 51/72] scripts/qmp-shell: remove prompt argument from read_exec_command |
Date: |
Fri, 18 Jun 2021 19:04:34 -0400 |
It's only ever used by one caller, we can just absorb that logic.
Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 20210607200649.1840382-22-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
---
scripts/qmp/qmp-shell | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/qmp/qmp-shell b/scripts/qmp/qmp-shell
index 3b86ef7d88..31269859c4 100755
--- a/scripts/qmp/qmp-shell
+++ b/scripts/qmp/qmp-shell
@@ -298,14 +298,14 @@ class QMPShell(qmp.QEMUMonitorProtocol):
return 'TRANS> '
return '(QEMU) '
- def read_exec_command(self, prompt):
+ def read_exec_command(self):
"""
Read and execute a command.
@return True if execution was ok, return False if disconnected.
"""
try:
- cmdline = input(prompt)
+ cmdline = input(self.prompt)
except EOFError:
print()
return False
@@ -436,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.prompt):
+ while qemu.read_exec_command():
pass
qemu.close()
--
2.31.1
- [PULL 31/72] scripts/qmp-shell: apply isort rules, (continued)
- [PULL 31/72] scripts/qmp-shell: apply isort rules, John Snow, 2021/06/18
- [PULL 39/72] scripts/qmp-shell: declare verbose in __init__, John Snow, 2021/06/18
- [PULL 40/72] scripts/qmp-shell: use triple-double-quote docstring style, John Snow, 2021/06/18
- [PULL 41/72] scripts/qmp-shell: ignore visit_Name name, John Snow, 2021/06/18
- [PULL 42/72] scripts/qmp-shell: make QMPCompleter returns explicit, John Snow, 2021/06/18
- [PULL 50/72] scripts/qmp-shell: move get_prompt() to prompt property, John Snow, 2021/06/18
- [PULL 23/72] scripts/qemu-ga-client: replace deprecated optparse with argparse, John Snow, 2021/06/18
- [PULL 25/72] scripts/qemu-ga-client: apply (most) pylint rules, John Snow, 2021/06/18
- [PULL 24/72] scripts/qemu-ga-client: add module docstring, John Snow, 2021/06/18
- [PULL 34/72] scripts/qmp-shell: fix exception handling, John Snow, 2021/06/18
- [PULL 51/72] scripts/qmp-shell: remove prompt argument from read_exec_command,
John Snow <=
- [PULL 53/72] scripts/qmp-shell: Fix "FuzzyJSON" parser, John Snow, 2021/06/18
- [PULL 54/72] scripts/qmp-shell: refactor QMPCompleter, John Snow, 2021/06/18
- [PULL 52/72] scripts/qmp-shell: move the REPL functionality into QMPShell, John Snow, 2021/06/18
- [PULL 47/72] scripts/qmp-shell: use argparse, John Snow, 2021/06/18
- [PULL 45/72] scripts/qmp-shell: remove if-raise-else patterns, John Snow, 2021/06/18
- [PULL 55/72] scripts/qmp-shell: initialize completer early, John Snow, 2021/06/18
- [PULL 56/72] python/qmp: add QMPObject type alias, John Snow, 2021/06/18
- [PULL 57/72] scripts/qmp-shell: add mypy types, John Snow, 2021/06/18
- [PULL 59/72] scripts/qmp-shell: unprivatize 'pretty' property, John Snow, 2021/06/18
- [PULL 60/72] python/qmp: return generic type from context manager, John Snow, 2021/06/18