From 06bd21f8c2545155b90c0dc6bbe62d61a2e8c4a3 Mon Sep 17 00:00:00 2001 From: anastasia-karpinska Date: Thu, 28 Nov 2013 14:27:37 +0200 Subject: [PATCH] All classes should explicitly inherit object class To avoid pylint errors six.with_metaclass was substituted with six.add_metaclass and explicit inheritance of object class. Change-Id: I516f111a9ba1af414b1a5daefad44b743af0412f --- taskflow/engines/action_engine/base_action.py | 3 ++- taskflow/engines/base.py | 3 ++- taskflow/flow.py | 3 ++- taskflow/jobs/jobboard.py | 3 ++- taskflow/listeners/base.py | 3 ++- taskflow/persistence/backends/base.py | 6 ++++-- taskflow/storage.py | 3 ++- taskflow/task.py | 3 ++- 8 files changed, 18 insertions(+), 9 deletions(-) diff --git a/taskflow/engines/action_engine/base_action.py b/taskflow/engines/action_engine/base_action.py index 211b18eb..8b8ca7fa 100644 --- a/taskflow/engines/action_engine/base_action.py +++ b/taskflow/engines/action_engine/base_action.py @@ -22,7 +22,8 @@ import abc import six -class Action(six.with_metaclass(abc.ABCMeta)): +@six.add_metaclass(abc.ABCMeta) +class Action(object): """Base action class""" @abc.abstractmethod diff --git a/taskflow/engines/base.py b/taskflow/engines/base.py index b627af08..42aaa28d 100644 --- a/taskflow/engines/base.py +++ b/taskflow/engines/base.py @@ -22,7 +22,8 @@ import abc import six -class EngineBase(six.with_metaclass(abc.ABCMeta)): +@six.add_metaclass(abc.ABCMeta) +class EngineBase(object): """Base for all engines implementations""" def __init__(self, flow, flow_detail, backend, conf): diff --git a/taskflow/flow.py b/taskflow/flow.py index a4d8bc16..72731b02 100644 --- a/taskflow/flow.py +++ b/taskflow/flow.py @@ -22,7 +22,8 @@ import six from taskflow.utils import reflection -class Flow(six.with_metaclass(abc.ABCMeta)): +@six.add_metaclass(abc.ABCMeta) +class Flow(object): """The base abstract class of all flow implementations. A flow is a structure that defines relationships between tasks. You can diff --git a/taskflow/jobs/jobboard.py b/taskflow/jobs/jobboard.py index b01fca0d..78d8ba6a 100644 --- a/taskflow/jobs/jobboard.py +++ b/taskflow/jobs/jobboard.py @@ -22,7 +22,8 @@ import abc import six -class JobBoard(six.with_metaclass(abc.ABCMeta)): +@six.add_metaclass(abc.ABCMeta) +class JobBoard(object): """A jobboard is an abstract representation of a place where jobs can be posted, reposted, claimed and transferred. There can be multiple implementations of this job board, depending on the desired semantics and diff --git a/taskflow/listeners/base.py b/taskflow/listeners/base.py index 2ff98639..3897486d 100644 --- a/taskflow/listeners/base.py +++ b/taskflow/listeners/base.py @@ -33,7 +33,8 @@ LOG = logging.getLogger(__name__) FINISH_STATES = (states.FAILURE, states.SUCCESS) -class LoggingBase(six.with_metaclass(abc.ABCMeta)): +@six.add_metaclass(abc.ABCMeta) +class LoggingBase(object): """This provides a simple listener that can be attached to an engine which can be derived from to log the received actions to some logging backend. It provides a useful context manager access to be able to register and diff --git a/taskflow/persistence/backends/base.py b/taskflow/persistence/backends/base.py index b405564e..e0c6f27d 100644 --- a/taskflow/persistence/backends/base.py +++ b/taskflow/persistence/backends/base.py @@ -21,7 +21,8 @@ import abc import six -class Backend(six.with_metaclass(abc.ABCMeta)): +@six.add_metaclass(abc.ABCMeta) +class Backend(object): """Base class for persistence backends.""" def __init__(self, conf): @@ -38,7 +39,8 @@ class Backend(six.with_metaclass(abc.ABCMeta)): pass -class Connection(six.with_metaclass(abc.ABCMeta)): +@six.add_metaclass(abc.ABCMeta) +class Connection(object): """Base class for backend connections.""" @abc.abstractproperty diff --git a/taskflow/storage.py b/taskflow/storage.py index 47aa4ad0..6c6ec6af 100644 --- a/taskflow/storage.py +++ b/taskflow/storage.py @@ -393,5 +393,6 @@ class Storage(object): return state -class ThreadSafeStorage(six.with_metaclass(tu.ThreadSafeMeta, Storage)): +@six.add_metaclass(tu.ThreadSafeMeta) +class ThreadSafeStorage(Storage): pass diff --git a/taskflow/task.py b/taskflow/task.py index feed1421..32bde962 100644 --- a/taskflow/task.py +++ b/taskflow/task.py @@ -108,7 +108,8 @@ def _build_arg_mapping(task_name, reqs, rebind_args, function, do_infer): return result -class BaseTask(six.with_metaclass(abc.ABCMeta)): +@six.add_metaclass(abc.ABCMeta) +class BaseTask(object): """An abstraction that defines a potential piece of work that can be applied and can be reverted to undo the work as a single unit. """