mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
target: Address pylint issues in ChromeOsTarget class
Also clean a mutable default value (``modules=[]`` in ``ChromeOsTarget`` class). Signed-off-by: Metin Kaya <metin.kaya@arm.com>
This commit is contained in:
parent
28b30649f1
commit
c6bd736c82
@ -2939,7 +2939,7 @@ def _get_part_name(section):
|
|||||||
variant = section.get('CPU variant', '0x0')
|
variant = section.get('CPU variant', '0x0')
|
||||||
name = get_cpu_name(*list(map(integer, [implementer, part, variant])))
|
name = get_cpu_name(*list(map(integer, [implementer, part, variant])))
|
||||||
if name is None:
|
if name is None:
|
||||||
name = '{}/{}/{}'.format(implementer, part, variant)
|
name = f'{implementer}/{part}/{variant}'
|
||||||
return name
|
return name
|
||||||
|
|
||||||
|
|
||||||
@ -2973,10 +2973,13 @@ def _build_path_tree(path_map, basepath, sep=os.path.sep, dictcls=dict):
|
|||||||
|
|
||||||
|
|
||||||
class ChromeOsTarget(LinuxTarget):
|
class ChromeOsTarget(LinuxTarget):
|
||||||
|
"""
|
||||||
|
Class for interacting with ChromeOS targets.
|
||||||
|
"""
|
||||||
|
|
||||||
os = 'chromeos'
|
os = 'chromeos'
|
||||||
|
|
||||||
# pylint: disable=too-many-locals
|
# pylint: disable=too-many-locals,too-many-arguments
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
connection_settings=None,
|
connection_settings=None,
|
||||||
platform=None,
|
platform=None,
|
||||||
@ -3009,17 +3012,17 @@ class ChromeOsTarget(LinuxTarget):
|
|||||||
if key in ssh_conn_params
|
if key in ssh_conn_params
|
||||||
)
|
)
|
||||||
|
|
||||||
super(ChromeOsTarget, self).__init__(connection_settings=self.ssh_connection_settings,
|
super().__init__(connection_settings=self.ssh_connection_settings,
|
||||||
platform=platform,
|
platform=platform,
|
||||||
working_directory=working_directory,
|
working_directory=working_directory,
|
||||||
executables_directory=executables_directory,
|
executables_directory=executables_directory,
|
||||||
connect=False,
|
connect=False,
|
||||||
modules=modules,
|
modules=modules,
|
||||||
load_default_modules=load_default_modules,
|
load_default_modules=load_default_modules,
|
||||||
shell_prompt=shell_prompt,
|
shell_prompt=shell_prompt,
|
||||||
conn_cls=SshConnection,
|
conn_cls=SshConnection,
|
||||||
is_container=is_container,
|
is_container=is_container,
|
||||||
max_async=max_async)
|
max_async=max_async)
|
||||||
|
|
||||||
# We can't determine if the target supports android until connected to the linux host so
|
# We can't determine if the target supports android until connected to the linux host so
|
||||||
# create unconditionally.
|
# create unconditionally.
|
||||||
@ -3037,16 +3040,15 @@ class ChromeOsTarget(LinuxTarget):
|
|||||||
self.android_connection_settings['device'] = connection_settings.get('host', None)
|
self.android_connection_settings['device'] = connection_settings.get('host', None)
|
||||||
|
|
||||||
self.android_container = AndroidTarget(connection_settings=self.android_connection_settings,
|
self.android_container = AndroidTarget(connection_settings=self.android_connection_settings,
|
||||||
platform=platform,
|
platform=platform,
|
||||||
working_directory=android_working_directory,
|
working_directory=android_working_directory,
|
||||||
executables_directory=android_executables_directory,
|
executables_directory=android_executables_directory,
|
||||||
connect=False,
|
connect=False,
|
||||||
modules=[], # Only use modules with linux target
|
load_default_modules=False,
|
||||||
load_default_modules=False,
|
shell_prompt=shell_prompt,
|
||||||
shell_prompt=shell_prompt,
|
conn_cls=AdbConnection,
|
||||||
conn_cls=AdbConnection,
|
package_data_directory=package_data_directory,
|
||||||
package_data_directory=package_data_directory,
|
is_container=True)
|
||||||
is_container=True)
|
|
||||||
if connect:
|
if connect:
|
||||||
self.connect()
|
self.connect()
|
||||||
|
|
||||||
@ -3056,15 +3058,15 @@ class ChromeOsTarget(LinuxTarget):
|
|||||||
if not present, use android implementation if available.
|
if not present, use android implementation if available.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
return super(ChromeOsTarget, self).__getattribute__(attr)
|
return super().__getattribute__(attr)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
if hasattr(self.android_container, attr):
|
if hasattr(self.android_container, attr):
|
||||||
return getattr(self.android_container, attr)
|
return getattr(self.android_container, attr)
|
||||||
else:
|
raise
|
||||||
raise
|
|
||||||
|
|
||||||
def connect(self, timeout=30, check_boot_completed=True, max_async=None):
|
@asyn.asyncf
|
||||||
super(ChromeOsTarget, self).connect(
|
async def connect(self, timeout=30, check_boot_completed=True, max_async=None):
|
||||||
|
super().connect(
|
||||||
timeout=timeout,
|
timeout=timeout,
|
||||||
check_boot_completed=check_boot_completed,
|
check_boot_completed=check_boot_completed,
|
||||||
max_async=max_async,
|
max_async=max_async,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user