mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-20 20:09:11 +00:00
Merge pull request #496 from bjackman/docstring-tweaks
Misc clarifications/cleanups
This commit is contained in:
commit
24d96c2397
@ -73,25 +73,23 @@ class PluginCache(object):
|
||||
if self.is_global_alias(plugin_name):
|
||||
self.add_global_alias(plugin_name, values, source)
|
||||
return
|
||||
for name, value in values.iteritems():
|
||||
self.add_config(plugin_name, name, value, source)
|
||||
|
||||
def add_config(self, plugin_name, name, value, source):
|
||||
if source not in self.sources:
|
||||
msg = "Source '{}' has not been added to the plugin cache."
|
||||
raise RuntimeError(msg.format(source))
|
||||
|
||||
if (not self.loader.has_plugin(plugin_name) and
|
||||
if (not self.loader.has_plugin(plugin_name) and
|
||||
plugin_name not in GENERIC_CONFIGS):
|
||||
msg = 'configuration provided for unknown plugin "{}"'
|
||||
raise ConfigError(msg.format(plugin_name))
|
||||
|
||||
if (plugin_name not in GENERIC_CONFIGS and
|
||||
name not in self.get_plugin_parameters(plugin_name)):
|
||||
msg = "'{}' is not a valid parameter for '{}'"
|
||||
raise ConfigError(msg.format(name, plugin_name))
|
||||
for name, value in values.iteritems():
|
||||
if (plugin_name not in GENERIC_CONFIGS and
|
||||
name not in self.get_plugin_parameters(plugin_name)):
|
||||
msg = "'{}' is not a valid parameter for '{}'"
|
||||
raise ConfigError(msg.format(name, plugin_name))
|
||||
|
||||
self.plugin_configs[plugin_name][source][name] = value
|
||||
self.plugin_configs[plugin_name][source][name] = value
|
||||
|
||||
def is_global_alias(self, name):
|
||||
return name in self._list_of_global_aliases
|
||||
@ -158,7 +156,7 @@ class PluginCache(object):
|
||||
return params
|
||||
|
||||
# pylint: disable=too-many-nested-blocks, too-many-branches
|
||||
def _merge_using_priority_specificity(self, specific_name,
|
||||
def _merge_using_priority_specificity(self, specific_name,
|
||||
generic_name, merged_config, is_final=True):
|
||||
"""
|
||||
WA configuration can come from various sources of increasing priority,
|
||||
@ -181,7 +179,7 @@ class PluginCache(object):
|
||||
:param generic_name: The name of the generic configuration
|
||||
e.g ``device_config``
|
||||
:param merge_config: A dict of ``ConfigurationPoint``s to be used when
|
||||
merging configuration. keys=config point name,
|
||||
merging configuration. keys=config point name,
|
||||
values=config point
|
||||
:param is_final: if ``True`` (the default) make sure that mandatory
|
||||
parameters are set.
|
||||
|
@ -75,7 +75,7 @@ def instantiate_assistant(tdesc, params, target):
|
||||
|
||||
class TargetDescription(object):
|
||||
|
||||
def __init__(self, name, source, description=None, target=None, platform=None,
|
||||
def __init__(self, name, source, description=None, target=None, platform=None,
|
||||
conn=None, assistant=None, target_params=None, platform_params=None,
|
||||
conn_params=None, assistant_params=None):
|
||||
self.name = name
|
||||
@ -122,7 +122,7 @@ class TargetDescriptor(Plugin):
|
||||
COMMON_TARGET_PARAMS = [
|
||||
Parameter('working_directory', kind=str,
|
||||
description='''
|
||||
On-target working directory that will be used by WA. This
|
||||
On-target working directory that will be used by WA. This
|
||||
directory must be writable by the user WA logs in as without
|
||||
the need for privilege elevation.
|
||||
'''),
|
||||
@ -143,7 +143,7 @@ COMMON_TARGET_PARAMS = [
|
||||
If additional modules need to be loaded, they may be specified
|
||||
using this parameter.
|
||||
|
||||
Please see ``devlab`` documentation for information on the available
|
||||
Please see ``devlib`` documentation for information on the available
|
||||
modules.
|
||||
'''),
|
||||
Parameter('load_default_modules', kind=bool, default=True,
|
||||
@ -153,10 +153,10 @@ COMMON_TARGET_PARAMS = [
|
||||
``True`` would suppress that, ensuring that only the base Target
|
||||
interface is initialized.
|
||||
|
||||
You may want to set this if there is a problem with one or more default
|
||||
modules on your platform (e.g. your device is unrooted and cpufreq is
|
||||
not accessible to unprivileged users), or if Target initialization is
|
||||
taking too long for your platform.
|
||||
You may want to set this to ``False`` if there is a problem with one
|
||||
or more default modules on your platform (e.g. your device is
|
||||
unrooted and cpufreq is not accessible to unprivileged users), or
|
||||
if ``Target`` initialization is taking too long for your platform.
|
||||
'''),
|
||||
]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user