scripts: Fix the flake8 syntax-check failures

Fix the syntax-check failures (which can be seen after
python3-flake8-import-order package is installed) with the help
of isort[1]:

289/316 libvirt:syntax-check / flake8   FAIL   5.24s   exit status 2

[1]: https://pycqa.github.io/isort/

Signed-off-by: Han Han <hhan@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Han Han 2023-06-05 15:40:13 +08:00 committed by Michal Privoznik
parent d7fb8deb6a
commit 28141adfdc
15 changed files with 26 additions and 27 deletions

View File

@ -1,8 +1,7 @@
import json import json
import pathlib import pathlib
import urllib.request
import urllib.parse import urllib.parse
import urllib.request
from typing import Dict, List from typing import Dict, List

2
run.in
View File

@ -44,8 +44,8 @@ import os
import os.path import os.path
import random import random
import signal import signal
import sys
import subprocess import subprocess
import sys
# Function to intelligently prepend a path to an environment variable. # Function to intelligently prepend a path to an environment variable.

View File

@ -8,11 +8,11 @@
# daniel@veillard.com # daniel@veillard.com
# #
import os
import sys
import glob
import re
import argparse import argparse
import glob
import os
import re
import sys
quiet = True quiet = True
warnings = 0 warnings = 0

View File

@ -16,10 +16,10 @@
# #
# Check that external references between documentation HTML files are not broken. # Check that external references between documentation HTML files are not broken.
import sys
import os
import argparse import argparse
import os
import re import re
import sys
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
ns = {'html': 'http://www.w3.org/1999/xhtml'} ns = {'html': 'http://www.w3.org/1999/xhtml'}

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import sys
import re import re
import sys
if len(sys.argv) != 2: if len(sys.argv) != 2:
print(f"usage: {sys.argv[0]} POTFILE", file=sys.stderr) print(f"usage: {sys.argv[0]} POTFILE", file=sys.stderr)

View File

@ -22,10 +22,9 @@
# <http://www.gnu.org/licenses/>. # <http://www.gnu.org/licenses/>.
# #
import sys
import os import os
import os.path import os.path
import sys
OCCURRENCE__REQUIRED_ITEM = "r" OCCURRENCE__REQUIRED_ITEM = "r"
OCCURRENCE__REQUIRED_LIST = "rl" OCCURRENCE__REQUIRED_LIST = "rl"

View File

@ -16,9 +16,9 @@
# License along with this library. If not, see # License along with this library. If not, see
# <http://www.gnu.org/licenses/>. # <http://www.gnu.org/licenses/>.
import sys
import os.path import os.path
import re import re
import sys
if len(sys.argv) != 3: if len(sys.argv) != 3:
print("syntax: %s TOP-SRCDIR TOP-BUILDDIR\n" % sys.argv[0], file=sys.stderr) print("syntax: %s TOP-SRCDIR TOP-BUILDDIR\n" % sys.argv[0], file=sys.stderr)

View File

@ -20,9 +20,9 @@
# <http://www.gnu.org/licenses/>. # <http://www.gnu.org/licenses/>.
# #
import sys
import os import os
import os.path import os.path
import sys
separator = "/*" + ("*" * 50) + "*\n" separator = "/*" + ("*" * 50) + "*\n"
wmi_classes_by_name = {} wmi_classes_by_name = {}

View File

@ -1,8 +1,8 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import os import os
import sys
import shutil import shutil
import sys
meson_build_root = sys.argv[1] meson_build_root = sys.argv[1]
file_name = sys.argv[2] file_name = sys.argv[2]

View File

@ -1,7 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import os import os
from datetime import datetime, timezone from datetime import datetime, timezone
timestamp = os.environ.get('SOURCE_DATE_EPOCH', None) timestamp = os.environ.get('SOURCE_DATE_EPOCH', None)

View File

@ -2,11 +2,12 @@
import argparse import argparse
import copy import copy
import lark
import os import os
import re import re
import xml.etree.ElementTree import xml.etree.ElementTree
import lark
def translate_vendor(name): def translate_vendor(name):
T = { T = {

View File

@ -10,7 +10,6 @@ import subprocess
import sys import sys
import xml.etree.ElementTree import xml.etree.ElementTree
_KEYS = { _KEYS = {
"cpuid": ["eax_in", "ecx_in"], "cpuid": ["eax_in", "ecx_in"],
"msr": ["index"], "msr": ["index"],

View File

@ -19,8 +19,8 @@
import os import os
import os.path import os.path
import sys
import subprocess import subprocess
import sys
builddir = os.getenv("abs_top_builddir") builddir = os.getenv("abs_top_builddir")
if builddir is None: if builddir is None:

View File

@ -2,16 +2,17 @@
import argparse import argparse
import array import array
import libvirt import fcntl
import libvirt_qemu import json
import os import os
import re import re
import socket import socket
import sys import sys
import traceback import traceback
import json
import fcntl
import libvirt
import libvirt_qemu
debug = False debug = False

View File

@ -36,22 +36,23 @@
import abc import abc
import argparse import argparse
from base64 import b64decode, b64encode
from hashlib import sha256
import hmac import hmac
import logging import logging
import os import os
import re import re
import socket import socket
from struct import pack
import sys import sys
import traceback import traceback
from base64 import b64decode, b64encode
from hashlib import sha256
from struct import pack
from uuid import UUID from uuid import UUID
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
import libvirt
from lxml import etree from lxml import etree
import libvirt
log = logging.getLogger() log = logging.getLogger()