From e60e31ff8e3197038b6ffcb3d9b87b6ecb5612b1 Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Fri, 7 Apr 2017 11:02:02 +0100 Subject: [PATCH] Imports: Updated Imports Switch remaining wlauto imports to wa. Added other missing imports. --- wa/commands/record.py | 6 ++++-- wa/framework/configuration/__init__.py | 9 ++++----- wa/framework/configuration/default.py | 8 ++++---- wa/framework/host.py | 2 +- wa/framework/plugin.py | 8 ++++---- wa/framework/signal.py | 6 +++--- wa/framework/workload.py | 3 ++- wa/tests/test_diff.py | 2 +- wa/utils/misc.py | 2 +- 9 files changed, 24 insertions(+), 22 deletions(-) diff --git a/wa/commands/record.py b/wa/commands/record.py index e45e8ff4..be72cd09 100644 --- a/wa/commands/record.py +++ b/wa/commands/record.py @@ -18,9 +18,11 @@ import sys from wa import Command, settings -from wa.framework.configuration import RunConfiguration +from wa.framework import pluginloader +from wa.framework.agenda import Agenda from wa.framework.resource import Executable, NO_ONE, ResourceResolver -from wa.utils.revent import ReventRecorder +from wa.framework.configuration import RunConfiguration +from wa.framework.workload import ApkUiautoWorkload class RecordCommand(Command): diff --git a/wa/framework/configuration/__init__.py b/wa/framework/configuration/__init__.py index a3593794..697a4811 100644 --- a/wa/framework/configuration/__init__.py +++ b/wa/framework/configuration/__init__.py @@ -12,8 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from wlauto.core.configuration.configuration import (settings, - RunConfiguration, - JobGenerator, - ConfigurationPoint) -from wlauto.core.configuration.plugin_cache import PluginCache +from wa.framework.configuration.core import (settings, + RunConfiguration, + JobGenerator, + ConfigurationPoint) diff --git a/wa/framework/configuration/default.py b/wa/framework/configuration/default.py index 5145a6b4..ddfec4af 100644 --- a/wa/framework/configuration/default.py +++ b/wa/framework/configuration/default.py @@ -1,7 +1,7 @@ -from wlauto.core.configuration.configuration import MetaConfiguration, RunConfiguration -from wlauto.core.configuration.plugin_cache import PluginCache -from wlauto.utils.serializer import yaml -from wlauto.utils.doc import strip_inlined_text +from wa.framework.configuration.core import MetaConfiguration, RunConfiguration +from wa.framework.configuration.plugin_cache import PluginCache +from wa.utils.serializer import yaml +from wa.utils.doc import strip_inlined_text DEFAULT_INSTRUMENTS = ['execution_time', 'interrupts', diff --git a/wa/framework/host.py b/wa/framework/host.py index 33810b93..43b1bf59 100644 --- a/wa/framework/host.py +++ b/wa/framework/host.py @@ -1,6 +1,6 @@ import os -from wlauto.core.configuration import settings +from wa.framework.configuration.core import settings def init_user_directory(overwrite_existing=False): # pylint: disable=R0914 """ diff --git a/wa/framework/plugin.py b/wa/framework/plugin.py index 7c8e5dba..c9828839 100644 --- a/wa/framework/plugin.py +++ b/wa/framework/plugin.py @@ -26,7 +26,7 @@ from itertools import chain from copy import copy from wa.framework.configuration.core import settings, ConfigurationPoint as Parameter -from wa.framework.exception import (NotFoundError, PluginLoaderError, +from wa.framework.exception import (NotFoundError, PluginLoaderError, TargetError, ValidationError, ConfigError, HostError) from wa.utils import log from wa.utils.misc import (ensure_directory_exists as _d, walk_modules, load_class, @@ -430,7 +430,7 @@ class Plugin(object): get_module(name, owner, **kwargs) - and returns an instance of :class:`wlauto.core.plugin.Module`. If the + and returns an instance of :class:`wa.core.plugin.Module`. If the module with the specified name is not found, the loader must raise an appropriate exception. @@ -743,10 +743,10 @@ class PluginLoader(object): self.logger.warning('Got: {}'.format(e)) else: msg = 'Failed to load {}' - raise LoaderError(msg.format(filepath), sys.exc_info()) + raise PluginLoaderError(msg.format(filepath), sys.exc_info()) except Exception as e: message = 'Problem loading plugins from {}: {}' - raise LoaderError(message.format(filepath, e)) + raise PluginLoaderError(message.format(filepath, e)) def _discover_in_module(self, module): # NOQA pylint: disable=too-many-branches self.logger.debug('Checking module %s', module.__name__) diff --git a/wa/framework/signal.py b/wa/framework/signal.py index 20c6a0b2..4f643933 100644 --- a/wa/framework/signal.py +++ b/wa/framework/signal.py @@ -231,7 +231,7 @@ def connect(handler, signal, sender=dispatcher.Any, priority=0): .. note:: There is nothing that prevents instrumentation from sending their own signals that are not part of the standard set. However the signal - must always be an :class:`wlauto.core.signal.Signal` instance. + must always be an :class:`wa.core.signal.Signal` instance. :sender: The handler will be invoked only for the signals emitted by this sender. By default, this is set to :class:`louie.dispatcher.Any`, so the handler will @@ -270,7 +270,7 @@ def disconnect(handler, signal, sender=dispatcher.Any): :handler: The callback to be disconnected. :signal: The signal the handler is to be disconnected form. It will - be an :class:`wlauto.core.signal.Signal` instance. + be an :class:`wa.core.signal.Signal` instance. :sender: If specified, the handler will only be disconnected from the signal sent by this sender. @@ -284,7 +284,7 @@ def send(signal, sender=dispatcher.Anonymous, *args, **kwargs): Paramters: - :signal: Signal to be sent. This must be an instance of :class:`wlauto.core.signal.Signal` + :signal: Signal to be sent. This must be an instance of :class:`wa.core.signal.Signal` or its subclasses. :sender: The sender of the signal (typically, this would be ``self``). Some handlers may only be subscribed to signals from a particular sender. diff --git a/wa/framework/workload.py b/wa/framework/workload.py index b2f565e3..e548d74d 100644 --- a/wa/framework/workload.py +++ b/wa/framework/workload.py @@ -17,7 +17,8 @@ import os import time from wa.framework.plugin import TargetedPlugin -from wa.framework.resource import ApkFile, JarFile, ReventFile, NO_ONE +from wa.framework.resource import (ApkFile, JarFile, ReventFile, NO_ONE, + Executable) from wa.framework.exception import WorkloadError from devlib.utils.android import ApkInfo diff --git a/wa/tests/test_diff.py b/wa/tests/test_diff.py index cc1683cc..52f6fbdf 100644 --- a/wa/tests/test_diff.py +++ b/wa/tests/test_diff.py @@ -22,7 +22,7 @@ from unittest import TestCase from nose.tools import assert_equal -from wlauto.instrumentation.misc import _diff_interrupt_files +from wa.instrumentation.misc import _diff_interrupt_files class InterruptDiffTest(TestCase): diff --git a/wa/utils/misc.py b/wa/utils/misc.py index 4a564c90..a41bbd22 100644 --- a/wa/utils/misc.py +++ b/wa/utils/misc.py @@ -54,7 +54,7 @@ from devlib.utils.misc import (ABI_MAP, check_output, walk_modules, check_output_logger = logging.getLogger('check_output') -# Defined here rather than in wlauto.exceptions due to module load dependencies +# Defined here rather than in wa.exceptions due to module load dependencies def diff_tokens(before_token, after_token): """ Creates a diff of two tokens.