From 7ccdea6b8e480ee6dbd3812d9cb699acdc80eecf Mon Sep 17 00:00:00 2001 From: Metin Kaya Date: Wed, 17 Jan 2024 12:15:14 +0000 Subject: [PATCH] devlib/init: Resolve pylint issues This is for increasing pylint score of __init__.py to 10/10. Signed-off-by: Metin Kaya --- devlib/__init__.py | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/devlib/__init__.py b/devlib/__init__.py index fe9965d..e496299 100644 --- a/devlib/__init__.py +++ b/devlib/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2018 ARM Limited +# Copyright 2024 ARM Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,9 +13,25 @@ # limitations under the License. # -from devlib.target import Target, LinuxTarget, AndroidTarget, LocalLinuxTarget, ChromeOsTarget -from devlib.host import PACKAGE_BIN_DIRECTORY -from devlib.exception import DevlibError, DevlibTransientError, DevlibStableError, TargetError, TargetTransientError, TargetStableError, TargetNotRespondingError, HostError +''' +Initializations for devlib module +''' + +from devlib.target import ( + Target, LinuxTarget, AndroidTarget, LocalLinuxTarget, + ChromeOsTarget, +) + +from devlib.host import ( + PACKAGE_BIN_DIRECTORY, + LocalConnection, +) + +from devlib.exception import ( + DevlibError, DevlibTransientError, DevlibStableError, + TargetError, TargetTransientError, TargetStableError, + TargetNotRespondingError, HostError, +) from devlib.module import Module, HardRestModule, BootModule, FlashModule from devlib.module import get_module, register_module @@ -52,10 +68,8 @@ from devlib.collector.serial_trace import SerialTraceCollector from devlib.collector.dmesg import DmesgCollector from devlib.collector.logcat import LogcatCollector -from devlib.host import LocalConnection from devlib.utils.android import AdbConnection from devlib.utils.ssh import SshConnection, TelnetConnection, Gem5Connection - from devlib.utils.version import (get_devlib_version as __get_devlib_version, get_commit as __get_commit) @@ -64,6 +78,6 @@ __version__ = __get_devlib_version() __commit = __get_commit() if __commit: - __full_version__ = '{}+{}'.format(__version__, __commit) + __full_version__ = f'{__version__}+{__commit}' else: __full_version__ = __version__