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
This commit is contained in:
anastasia-karpinska
2013-11-28 14:27:37 +02:00
parent 4400723399
commit 06bd21f8c2
8 changed files with 18 additions and 9 deletions

View File

@@ -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

View File

@@ -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):

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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.
"""