scripts: west_commands: runners: Sort and format imports (I001)
Apply sorting and formatting rules on imports. See https://docs.astral.sh/ruff/rules/unsorted-imports/ Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
parent
93457b42f9
commit
bf7f41d880
37 changed files with 71 additions and 65 deletions
|
|
@ -11,7 +11,7 @@ import signal
|
|||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
try:
|
||||
import serial.tools.list_ports
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import subprocess
|
|||
import sys
|
||||
import time
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
if platform.system() == 'Darwin':
|
||||
DEFAULT_BOSSAC_PORT = None
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import argparse
|
|||
import os
|
||||
import time
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
try:
|
||||
import canopen
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ import socket
|
|||
import subprocess
|
||||
import sys
|
||||
from dataclasses import dataclass, field
|
||||
from functools import partial
|
||||
from enum import Enum
|
||||
from functools import partial
|
||||
from inspect import isabstract
|
||||
from typing import NamedTuple, NoReturn
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
import platform
|
||||
import subprocess
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
DPCMD_EXE = 'dpcmd.exe' if platform.system() == 'Windows' else 'dpcmd'
|
||||
DEFAULT_MAX_RETRIES = 3
|
||||
|
|
|
|||
|
|
@ -4,13 +4,11 @@
|
|||
|
||||
'''Runner for flashing with dfu-util.'''
|
||||
|
||||
from collections import namedtuple
|
||||
import sys
|
||||
import time
|
||||
from collections import namedtuple
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps, \
|
||||
BuildConfiguration
|
||||
|
||||
from runners.core import BuildConfiguration, RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
DfuSeConfig = namedtuple('DfuSeConfig', ['address', 'options'])
|
||||
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@
|
|||
|
||||
'''Runner for flashing ESP32 devices with esptool/espidf.'''
|
||||
|
||||
from os import path
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
|
||||
import os
|
||||
import sys
|
||||
from os import path
|
||||
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
|
||||
class Esp32BinaryRunner(ZephyrBinaryRunner):
|
||||
'''Runner front-end for espidf.'''
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
'''Runner for flashing with ezFlashCLI.'''
|
||||
import shlex
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
DEFAULT_EZFLASHCLI = "ezFlashCLI"
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
'''GigaDevice ISP tool (gd32isp) runner for serial boot ROM'''
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
DEFAULT_GD32ISP_CLI = 'GD32_ISP_Console'
|
||||
DEFAULT_GD32ISP_PORT = '/dev/ttyUSB0'
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
from os import path
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
|
||||
class HiFive1BinaryRunner(ZephyrBinaryRunner):
|
||||
|
|
|
|||
|
|
@ -5,15 +5,17 @@
|
|||
'''Runner for flashing with the Intel ADSP boards.'''
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
import re
|
||||
import hashlib
|
||||
import os
|
||||
import random
|
||||
import re
|
||||
import shutil
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
import sys
|
||||
|
||||
from zephyr_ext_common import ZEPHYR_BASE
|
||||
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
DEFAULT_CAVSTOOL='soc/intel/intel_adsp/tools/cavstool_client.py'
|
||||
|
||||
class SignParamError(argparse.Action):
|
||||
|
|
|
|||
|
|
@ -4,14 +4,13 @@
|
|||
|
||||
'''Modified openocd and gdb runner for Cyclone V SoC DevKit.'''
|
||||
|
||||
import subprocess
|
||||
import re
|
||||
import os
|
||||
|
||||
import re
|
||||
import subprocess
|
||||
from os import path
|
||||
from pathlib import Path
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
DEFAULT_OPENOCD_TCL_PORT = 6333
|
||||
DEFAULT_OPENOCD_TELNET_PORT = 4444
|
||||
|
|
|
|||
|
|
@ -8,15 +8,15 @@ import argparse
|
|||
import ipaddress
|
||||
import logging
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shlex
|
||||
import socket
|
||||
import subprocess
|
||||
import sys
|
||||
import socket
|
||||
import time
|
||||
import tempfile
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps, FileType
|
||||
from runners.core import FileType, RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
try:
|
||||
import pylink
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ import shlex
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
DEFAULT_LINKSERVER_EXE = 'Linkserver.exe' if sys.platform == 'win32' else 'LinkServer'
|
||||
DEFAULT_LINKSERVER_GDB_PORT = 3333
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
'''Runners for Synopsys Metaware Debugger(mdb).'''
|
||||
|
||||
|
||||
import shutil
|
||||
import os
|
||||
import shutil
|
||||
from os import path
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
|
||||
# normally we should create class with common functionality inherited from
|
||||
|
|
|
|||
|
|
@ -10,9 +10,11 @@ you're willing to handle requests for help. E.g. if your "board" is a
|
|||
core on a special-purpose SoC which requires a complicated script to
|
||||
network boot.'''
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
import argparse
|
||||
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
|
||||
class MiscFlasher(ZephyrBinaryRunner):
|
||||
'''Runner for handling special purpose flashing commands.'''
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
flashing (running) a native application."""
|
||||
|
||||
import argparse
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps, RunnerConfig
|
||||
|
||||
from runners.core import RunnerCaps, RunnerConfig, ZephyrBinaryRunner
|
||||
|
||||
DEFAULT_GDB_PORT = 3333
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
'''Runner for NIOS II, based on quartus-flash.py and GDB.'''
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, NetworkPortHelper, RunnerCaps
|
||||
from runners.core import NetworkPortHelper, RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
|
||||
class Nios2BinaryRunner(ZephyrBinaryRunner):
|
||||
|
|
|
|||
|
|
@ -6,22 +6,22 @@
|
|||
'''Runner base class for flashing with nrf tools.'''
|
||||
|
||||
import abc
|
||||
from collections import deque
|
||||
import contextlib
|
||||
import functools
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shlex
|
||||
import subprocess
|
||||
import sys
|
||||
from re import fullmatch, escape
|
||||
from collections import deque
|
||||
from pathlib import Path
|
||||
from re import escape, fullmatch
|
||||
|
||||
from zephyr_ext_common import ZEPHYR_BASE
|
||||
|
||||
sys.path.append(os.fspath(Path(__file__).parent.parent.parent))
|
||||
import zephyr_module
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
try:
|
||||
from intelhex import IntelHex
|
||||
|
|
|
|||
|
|
@ -8,8 +8,7 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from runners.nrf_common import ErrNotAvailableBecauseProtection, ErrVerify, \
|
||||
NrfBinaryRunner
|
||||
from runners.nrf_common import ErrNotAvailableBecauseProtection, ErrVerify, NrfBinaryRunner
|
||||
|
||||
# https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nrf_cltools%2FUG%2Fcltools%2Fnrf_nrfjprogexe_return_codes.html&cp=9_1_3_1
|
||||
UnavailableOperationBecauseProtectionError = 16
|
||||
|
|
|
|||
|
|
@ -6,13 +6,14 @@
|
|||
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import sys
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from runners.core import _DRY_RUN
|
||||
from runners.nrf_common import NrfBinaryRunner
|
||||
|
||||
|
||||
class NrfUtilBinaryRunner(NrfBinaryRunner):
|
||||
'''Runner front-end for nrfutil.'''
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
from os import path
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
DEFAULT_ARC_GDB_PORT = 3333
|
||||
DEFAULT_PROPS_FILE = 'nsim_em.props'
|
||||
|
|
|
|||
|
|
@ -15,8 +15,7 @@ import tempfile
|
|||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
|
||||
from runners.core import (BuildConfiguration, RunnerCaps, RunnerConfig,
|
||||
ZephyrBinaryRunner)
|
||||
from runners.core import BuildConfiguration, RunnerCaps, RunnerConfig, ZephyrBinaryRunner
|
||||
|
||||
NXP_S32DBG_USB_CLASS = 'NXP Probes'
|
||||
NXP_S32DBG_USB_VID = 0x15a2
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@
|
|||
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
from os import path
|
||||
from pathlib import Path
|
||||
|
||||
from zephyr_ext_common import ZEPHYR_BASE
|
||||
|
||||
try: # noqa SIM105
|
||||
|
|
@ -19,7 +19,7 @@ try: # noqa SIM105
|
|||
except ImportError:
|
||||
pass
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
DEFAULT_OPENOCD_TCL_PORT = 6333
|
||||
DEFAULT_OPENOCD_TELNET_PORT = 4444
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
'''Runner for probe-rs.'''
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
|
||||
class ProbeRsBinaryRunner(ZephyrBinaryRunner):
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
import os
|
||||
from os import path
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps, BuildConfiguration
|
||||
from runners.core import BuildConfiguration, RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
DEFAULT_PYOCD_GDB_PORT = 3333
|
||||
DEFAULT_PYOCD_TELNET_PORT = 4444
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
'''Runner stub for QEMU.'''
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
|
||||
class QemuBinaryRunner(ZephyrBinaryRunner):
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
'''Runner stub for renode-test.'''
|
||||
|
||||
import subprocess
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
|
||||
class RenodeRobotRunner(ZephyrBinaryRunner):
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
'''Runner stub for Renode.'''
|
||||
|
||||
import subprocess
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
|
||||
class RenodeRunner(ZephyrBinaryRunner):
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ See SiLabs UG162: "Simplicity Commander Reference Guide" for more info.
|
|||
|
||||
import os
|
||||
import shlex
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps, FileType
|
||||
|
||||
from runners.core import FileType, RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
DEFAULT_APP = 'commander'
|
||||
|
||||
|
|
|
|||
|
|
@ -2,12 +2,13 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import re
|
||||
import os
|
||||
import time
|
||||
import re
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
from runners.core import BuildConfiguration, RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps, BuildConfiguration
|
||||
|
||||
class SpiBurnBinaryRunner(ZephyrBinaryRunner):
|
||||
'''Runner front-end for SPI_burn.'''
|
||||
|
|
|
|||
|
|
@ -7,14 +7,14 @@
|
|||
"""
|
||||
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
import platform
|
||||
import os
|
||||
import platform
|
||||
import shlex
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
from typing import ClassVar
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps, RunnerConfig
|
||||
from runners.core import RunnerCaps, RunnerConfig, ZephyrBinaryRunner
|
||||
|
||||
|
||||
class STM32CubeProgrammerBinaryRunner(ZephyrBinaryRunner):
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
|
||||
'''Runner for flashing with stm32flash.'''
|
||||
|
||||
from os import path
|
||||
import platform
|
||||
from os import path
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
DEFAULT_DEVICE = '/dev/ttyUSB0'
|
||||
if platform.system() == 'Darwin':
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import subprocess
|
|||
|
||||
from runners.core import ZephyrBinaryRunner
|
||||
|
||||
|
||||
class TeensyBinaryRunner(ZephyrBinaryRunner):
|
||||
'''Runner front-end for teensy.'''
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
from pathlib import Path
|
||||
from shutil import copy
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
try:
|
||||
import psutil
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@
|
|||
"""
|
||||
import argparse
|
||||
import os
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps, RunnerConfig
|
||||
|
||||
from runners.core import RunnerCaps, RunnerConfig, ZephyrBinaryRunner
|
||||
|
||||
|
||||
class XSDBBinaryRunner(ZephyrBinaryRunner):
|
||||
def __init__(self, cfg: RunnerConfig, config=None, bitstream=None,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
from os import path
|
||||
|
||||
from runners.core import ZephyrBinaryRunner, RunnerCaps
|
||||
from runners.core import RunnerCaps, ZephyrBinaryRunner
|
||||
|
||||
|
||||
class XtensaBinaryRunner(ZephyrBinaryRunner):
|
||||
|
|
|
|||
Loading…
Reference in a new issue