03.06.2020 03:15, John Snow wrote:
move python/qemu/*.py to python/qemu/core/*.py.

To create a namespace package, the 'qemu' directory itself shouldn't
have module files in it. Thus, these files will go under a 'lib' package
directory instead.

Bolster the core/__init__.py file a little bit, Make the top-level
classes and functions available directly inside the `qemu.core`
namespace, to facilitate a convenient shorthand:

from qemu.core import QEMUQtestMachine, QEMUMonitorProtocol

Lastly, update all of the existing import directives.

(Note: these scripts were not necessarily tested to see if they still
work. Some of these scripts are in obvious states of disrepair and it is
beyond the scope of this patch to attempt to fix them.)


RFC: For now, I have used the 'qemu.core' namespace to provide a group
of related tools. I liked Daniel's suggestion of using qemu.machine (and
possible qemu.monitor), but that requires me to rewrite the import
statements and understand a bit more about how to configure
pylint/mypy/flake8 and it's not right to focus on that right now. In the
interest of expedience, I've chosen to keep everything in one package to
be able to send another RFC patchset.

Signed-off-by: John Snow <js...@redhat.com>
---

[..]

--- a/scripts/render_block_graph.py
+++ b/scripts/render_block_graph.py
@@ -25,10 +25,8 @@
  from graphviz import Digraph
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'python'))
-from qemu.qmp import (
-    QEMUMonitorProtocol,
-    QMPResponseError,
-)
+from qemu.core import QEMUMonitorProtocol
+from qemu.core.machine import MonitorResponseError

it should be
+from qemu.core.qmp import QMPResponseError

with that fixed:
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com>



--
Best regards,
Vladimir

Reply via email to