python/qemu: use isort to lay out imports
authorJohn Snow <jsnow@redhat.com>
Tue, 6 Oct 2020 23:57:58 +0000 (19:57 -0400)
committerJohn Snow <jsnow@redhat.com>
Tue, 20 Oct 2020 13:37:57 +0000 (09:37 -0400)
Borrowed from the QAPI cleanup series, use the same configuration to
standardize the way we write and sort imports.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-id: 20201006235817.3280413-2-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
python/qemu/.isort.cfg [new file with mode: 0644]
python/qemu/accel.py
python/qemu/console_socket.py
python/qemu/machine.py
python/qemu/qmp.py
python/qemu/qtest.py

diff --git a/python/qemu/.isort.cfg b/python/qemu/.isort.cfg
new file mode 100644 (file)
index 0000000..6d0fd6c
--- /dev/null
@@ -0,0 +1,7 @@
+[settings]
+force_grid_wrap=4
+force_sort_within_sections=True
+include_trailing_comma=True
+line_length=72
+lines_after_imports=2
+multi_line_output=3
\ No newline at end of file
index 7fabe62920801e92b119bada18ffe35b197b2214..3ec6bdcfdb50c09bda951297ed082f1a7af5a633 100644 (file)
@@ -18,6 +18,7 @@ import logging
 import os
 import subprocess
 
+
 LOG = logging.getLogger(__name__)
 
 # Mapping host architecture to any additional architectures it can
index 70869fbbdc44f28634d2a58077f9a5cedd12906a..69f604c77fe5646b18e2a8121224100d7543bb6e 100644 (file)
@@ -13,9 +13,9 @@ which can drain a socket and optionally dump the bytes to file.
 # the COPYING file in the top-level directory.
 #
 
+from collections import deque
 import socket
 import threading
-from collections import deque
 import time
 
 
index 82f3731fc3f34677fb5946f7ab0c292d2358f876..bc83f399c1b568b2a6fc5acf34363a126a84ca53 100644 (file)
@@ -20,15 +20,15 @@ which provides facilities for managing the lifetime of a QEMU VM.
 import errno
 import logging
 import os
-import subprocess
 import shutil
 import signal
+import subprocess
 import tempfile
-from typing import Optional, Type
 from types import TracebackType
-from . import console_socket
+from typing import Optional, Type
+
+from . import console_socket, qmp
 
-from . import qmp
 
 LOG = logging.getLogger(__name__)
 
index 7935dababbf62b4d025f3ce6c1e010d95c8badd6..ddf8347ac1290fff4cc8fb9113e360a989453a43 100644 (file)
@@ -7,21 +7,21 @@
 # This work is licensed under the terms of the GNU GPL, version 2.  See
 # the COPYING file in the top-level directory.
 
-import json
 import errno
-import socket
+import json
 import logging
+import socket
+from types import TracebackType
 from typing import (
     Any,
-    cast,
     Dict,
     Optional,
     TextIO,
-    Type,
     Tuple,
+    Type,
     Union,
+    cast,
 )
-from types import TracebackType
 
 
 # QMPMessage is a QMP Message of any kind.
index 888c8bd2f60adac4f8c0914624d5dba74af16e08..7700c0b09b6c107035015407f988f10a747ab216 100644 (file)
@@ -17,8 +17,8 @@ subclass of QEMUMachine, respectively.
 # Based on qmp.py.
 #
 
-import socket
 import os
+import socket
 from typing import Optional, TextIO
 
 from .machine import QEMUMachine