From 0a67e94709773404c5346a7303803f216e3d4610 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Fri, 15 Dec 2017 09:45:08 +0000 Subject: [PATCH] framework/target: rename get_target_descriptions Rename get_target_descriptions to list_target_descriptions. --- wa/commands/create.py | 4 ++-- wa/commands/list.py | 4 ++-- wa/commands/show.py | 4 ++-- wa/framework/configuration/plugin_cache.py | 4 ++-- wa/framework/target/descriptor.py | 2 +- wa/framework/target/manager.py | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/wa/commands/create.py b/wa/commands/create.py index 5048fc8a..011d6856 100644 --- a/wa/commands/create.py +++ b/wa/commands/create.py @@ -6,7 +6,7 @@ from collections import OrderedDict from distutils.dir_util import copy_tree from wa import ComplexCommand, SubCommand, pluginloader, settings -from wa.framework.target.descriptor import get_target_descriptions +from wa.framework.target.descriptor import list_target_descriptions from wa.framework.exception import ConfigError, CommandError from wa.utils.misc import (ensure_directory_exists as _d, capitalize, ensure_file_directory_exists as _f) @@ -41,7 +41,7 @@ class CreateAgendaSubcommand(SubCommand): agenda['workloads'] = [] target_desc = None - targets = {td.name: td for td in get_target_descriptions()} + targets = {td.name: td for td in list_target_descriptions()} for name in args.plugins: if name in targets: diff --git a/wa/commands/list.py b/wa/commands/list.py index eba3c87a..fd4f4301 100644 --- a/wa/commands/list.py +++ b/wa/commands/list.py @@ -15,7 +15,7 @@ from wa import Command from wa.framework import pluginloader -from wa.framework.target.descriptor import get_target_descriptions +from wa.framework.target.descriptor import list_target_descriptions from wa.utils.doc import get_summary from wa.utils.formatter import DescriptionListFormatter @@ -65,7 +65,7 @@ def get_kinds(): def list_targets(): - targets = get_target_descriptions() + targets = list_target_descriptions() targets = sorted(targets, key=lambda x: x.name) output = DescriptionListFormatter() diff --git a/wa/commands/show.py b/wa/commands/show.py index fbe6fba2..a9a6acb5 100644 --- a/wa/commands/show.py +++ b/wa/commands/show.py @@ -17,7 +17,7 @@ from subprocess import call, Popen, PIPE from wa import Command from wa.framework import pluginloader from wa.framework.exception import NotFoundError -from wa.framework.target.descriptor import get_target_descriptions +from wa.framework.target.descriptor import list_target_descriptions from wa.utils.doc import (strip_inlined_text, get_rst_from_plugin, get_params_rst, underline) from wa.utils.misc import which @@ -71,7 +71,7 @@ def get_plugin(name): def get_target_description(name): - targets = get_target_descriptions() + targets = list_target_descriptions() for target in targets: if name == target.name: return target diff --git a/wa/framework/configuration/plugin_cache.py b/wa/framework/configuration/plugin_cache.py index 141e9c93..c243cb8f 100644 --- a/wa/framework/configuration/plugin_cache.py +++ b/wa/framework/configuration/plugin_cache.py @@ -21,7 +21,7 @@ from devlib.utils.misc import memoized from wa.framework import pluginloader from wa.framework.configuration.core import get_config_point_map from wa.framework.exception import ConfigError -from wa.framework.target.descriptor import get_target_descriptions +from wa.framework.target.descriptor import list_target_descriptions from wa.utils.types import obj_dict GENERIC_CONFIGS = ["device_config", "workload_parameters", @@ -42,7 +42,7 @@ class PluginCache(object): self.sources = [] self.plugin_configs = defaultdict(lambda: defaultdict(dict)) self.global_alias_values = defaultdict(dict) - self.targets = {td.name: td for td in get_target_descriptions()} + self.targets = {td.name: td for td in list_target_descriptions()} # Generate a mapping of what global aliases belong to self._global_alias_map = defaultdict(dict) diff --git a/wa/framework/target/descriptor.py b/wa/framework/target/descriptor.py index 16a7d6ce..59f08a95 100644 --- a/wa/framework/target/descriptor.py +++ b/wa/framework/target/descriptor.py @@ -16,7 +16,7 @@ from wa.utils.types import list_of_strings, list_of_ints, regex from wa.utils.misc import isiterable -def get_target_descriptions(loader=pluginloader): +def list_target_descriptions(loader=pluginloader): targets = {} for cls in loader.list_target_descriptors(): descriptor = cls() diff --git a/wa/framework/target/manager.py b/wa/framework/target/manager.py index c737165c..b8ca095e 100644 --- a/wa/framework/target/manager.py +++ b/wa/framework/target/manager.py @@ -2,7 +2,7 @@ import logging from wa.framework import signal from wa.framework.plugin import Parameter -from wa.framework.target.descriptor import (get_target_descriptions, +from wa.framework.target.descriptor import (list_target_descriptions, instantiate_target, instantiate_assistant) from wa.framework.target.info import TargetInfo @@ -83,7 +83,7 @@ class TargetManager(object): self.rpm.commit_runtime_parameters(parameters) def _init_target(self): - target_map = {td.name: td for td in get_target_descriptions()} + target_map = {td.name: td for td in list_target_descriptions()} if self.target_name not in target_map: raise ValueError('Unknown Target: {}'.format(self.target_name)) tdesc = target_map[self.target_name]