Fix some misspellings in the function name and descriptions
Change-Id: I7e3451feb94b1f25b00c5e7b197bb6b527548306
This commit is contained in:
@@ -101,11 +101,11 @@ class Compilation(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def hierarchy(self):
|
def hierarchy(self):
|
||||||
"""The hierachy of patterns (as a tree structure)."""
|
"""The hierarchy of patterns (as a tree structure)."""
|
||||||
return self._hierarchy
|
return self._hierarchy
|
||||||
|
|
||||||
|
|
||||||
def _overlap_occurence_detector(to_graph, from_graph):
|
def _overlap_occurrence_detector(to_graph, from_graph):
|
||||||
"""Returns how many nodes in 'from' graph are in 'to' graph (if any)."""
|
"""Returns how many nodes in 'from' graph are in 'to' graph (if any)."""
|
||||||
return iter_utils.count(node for node in from_graph.nodes_iter()
|
return iter_utils.count(node for node in from_graph.nodes_iter()
|
||||||
if node in to_graph)
|
if node in to_graph)
|
||||||
@@ -167,7 +167,7 @@ class FlowCompiler(object):
|
|||||||
for child in flow)
|
for child in flow)
|
||||||
decomposed_graphs = list(six.itervalues(decomposed))
|
decomposed_graphs = list(six.itervalues(decomposed))
|
||||||
graph = gr.merge_graphs(graph, *decomposed_graphs,
|
graph = gr.merge_graphs(graph, *decomposed_graphs,
|
||||||
overlap_detector=_overlap_occurence_detector)
|
overlap_detector=_overlap_occurrence_detector)
|
||||||
for u, v, attr_dict in flow.iter_links():
|
for u, v, attr_dict in flow.iter_links():
|
||||||
u_graph = decomposed[u]
|
u_graph = decomposed[u]
|
||||||
v_graph = decomposed[v]
|
v_graph = decomposed[v]
|
||||||
@@ -270,7 +270,7 @@ class PatternCompiler(object):
|
|||||||
of tasks ``(b, c)`` and task ``d``.
|
of tasks ``(b, c)`` and task ``d``.
|
||||||
|
|
||||||
The algorithm that will be performed (mirroring the above described logic)
|
The algorithm that will be performed (mirroring the above described logic)
|
||||||
will go through the following steps (the tree hierachy building is left
|
will go through the following steps (the tree hierarchy building is left
|
||||||
out as that is more obvious)::
|
out as that is more obvious)::
|
||||||
|
|
||||||
Compiling f
|
Compiling f
|
||||||
|
|||||||
@@ -673,7 +673,7 @@ class ParallelProcessTaskExecutor(base.ParallelTaskExecutor):
|
|||||||
def rebind_task():
|
def rebind_task():
|
||||||
# Creates and binds proxies for all events the task could receive
|
# Creates and binds proxies for all events the task could receive
|
||||||
# so that when the clone runs in another process that this task
|
# so that when the clone runs in another process that this task
|
||||||
# can recieve the same notifications (thus making it look like the
|
# can receive the same notifications (thus making it look like the
|
||||||
# the notifications are transparently happening in this process).
|
# the notifications are transparently happening in this process).
|
||||||
needed = set()
|
needed = set()
|
||||||
for (event_type, listeners) in task.notifier.listeners_iter():
|
for (event_type, listeners) in task.notifier.listeners_iter():
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ class Engine(object):
|
|||||||
If a flow had previously ended up (from a prior engine
|
If a flow had previously ended up (from a prior engine
|
||||||
:py:func:`.run`) in the ``FAILURE``, ``SUCCESS`` or ``REVERTED``
|
:py:func:`.run`) in the ``FAILURE``, ``SUCCESS`` or ``REVERTED``
|
||||||
states (or for some reason it ended up in an intermediary state) it
|
states (or for some reason it ended up in an intermediary state) it
|
||||||
can be desireable to make it possible to run it again. Calling this
|
can be desirable to make it possible to run it again. Calling this
|
||||||
method enables that to occur (without causing a state transition
|
method enables that to occur (without causing a state transition
|
||||||
failure, which would typically occur if :py:meth:`.run` is called
|
failure, which would typically occur if :py:meth:`.run` is called
|
||||||
directly without doing a reset).
|
directly without doing a reset).
|
||||||
|
|||||||
@@ -406,7 +406,7 @@ class ZookeeperJobBoard(base.NotifyingJobBoard):
|
|||||||
path, exc_info=True)
|
path, exc_info=True)
|
||||||
else:
|
else:
|
||||||
with self._job_cond:
|
with self._job_cond:
|
||||||
# Now we can offically check if someone already placed this
|
# Now we can officially check if someone already placed this
|
||||||
# jobs information into the known job set (if it's already
|
# jobs information into the known job set (if it's already
|
||||||
# existing then just leave it alone).
|
# existing then just leave it alone).
|
||||||
if path not in self._known_jobs:
|
if path not in self._known_jobs:
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ class Job(object):
|
|||||||
otherwise return true (a job failure exception may also be raised if
|
otherwise return true (a job failure exception may also be raised if
|
||||||
the job information can not be read, for whatever reason). Periodic
|
the job information can not be read, for whatever reason). Periodic
|
||||||
state checks will happen every ``delay`` seconds where ``delay`` will
|
state checks will happen every ``delay`` seconds where ``delay`` will
|
||||||
be multipled by the given multipler after a state is found that is
|
be multiplied by the given multipler after a state is found that is
|
||||||
**not** complete.
|
**not** complete.
|
||||||
|
|
||||||
Note that if no timeout is given this is equivalent to blocking
|
Note that if no timeout is given this is equivalent to blocking
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ class Flow(flow.Flow):
|
|||||||
execute (or whether the execution of ``v`` should be
|
execute (or whether the execution of ``v`` should be
|
||||||
ignored, and therefore not executed). It is expected
|
ignored, and therefore not executed). It is expected
|
||||||
to take as single keyword argument ``history`` which
|
to take as single keyword argument ``history`` which
|
||||||
will be the execution results of all ``u`` decideable
|
will be the execution results of all ``u`` decidable
|
||||||
links that have ``v`` as a target. It is expected to
|
links that have ``v`` as a target. It is expected to
|
||||||
return a single boolean (``True`` to allow ``v``
|
return a single boolean (``True`` to allow ``v``
|
||||||
execution or ``False`` to not).
|
execution or ``False`` to not).
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class FakeFilesystem(object):
|
|||||||
:meth:`~taskflow.persistence.backends.impl_memory.FakeFilesystem.get`
|
:meth:`~taskflow.persistence.backends.impl_memory.FakeFilesystem.get`
|
||||||
or other read-only actions (like calling into
|
or other read-only actions (like calling into
|
||||||
:meth:`~taskflow.persistence.backends.impl_memory.FakeFilesystem.ls`)
|
:meth:`~taskflow.persistence.backends.impl_memory.FakeFilesystem.ls`)
|
||||||
are occuring at the same time.
|
are occurring at the same time.
|
||||||
|
|
||||||
Example usage:
|
Example usage:
|
||||||
|
|
||||||
|
|||||||
@@ -1028,7 +1028,7 @@ class Storage(object):
|
|||||||
optional_args=None):
|
optional_args=None):
|
||||||
"""Fetch ``execute`` arguments for an atom using its args mapping."""
|
"""Fetch ``execute`` arguments for an atom using its args mapping."""
|
||||||
def _extract_first_from(name, sources):
|
def _extract_first_from(name, sources):
|
||||||
"""Extracts/returns first occurence of key in list of dicts."""
|
"""Extracts/returns first occurrence of key in list of dicts."""
|
||||||
for i, source in enumerate(sources):
|
for i, source in enumerate(sources):
|
||||||
if not source:
|
if not source:
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -460,7 +460,7 @@ class FailureCausesTest(test.TestCase):
|
|||||||
f = f.causes[0]
|
f = f.causes[0]
|
||||||
self.assertEqual(0, len(f.causes))
|
self.assertEqual(0, len(f.causes))
|
||||||
|
|
||||||
def test_causes_supress_context(self):
|
def test_causes_suppress_context(self):
|
||||||
f = None
|
f = None
|
||||||
try:
|
try:
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -151,13 +151,13 @@ b %(edge)s c;
|
|||||||
self.assertRaises(ValueError,
|
self.assertRaises(ValueError,
|
||||||
graph.merge_graphs, g, g2)
|
graph.merge_graphs, g, g2)
|
||||||
|
|
||||||
def occurence_detector(to_graph, from_graph):
|
def occurrence_detector(to_graph, from_graph):
|
||||||
return sum(1 for node in from_graph.nodes_iter()
|
return sum(1 for node in from_graph.nodes_iter()
|
||||||
if node in to_graph)
|
if node in to_graph)
|
||||||
|
|
||||||
self.assertRaises(ValueError,
|
self.assertRaises(ValueError,
|
||||||
graph.merge_graphs, g, g2,
|
graph.merge_graphs, g, g2,
|
||||||
overlap_detector=occurence_detector)
|
overlap_detector=occurrence_detector)
|
||||||
|
|
||||||
g3 = graph.merge_graphs(g, g2, allow_overlaps=True)
|
g3 = graph.merge_graphs(g, g2, allow_overlaps=True)
|
||||||
self.assertEqual(3, len(g3))
|
self.assertEqual(3, len(g3))
|
||||||
|
|||||||
@@ -324,7 +324,7 @@ class Failure(mixins.StrMixin):
|
|||||||
"""Re-raise exceptions if argument is not empty.
|
"""Re-raise exceptions if argument is not empty.
|
||||||
|
|
||||||
If argument is empty list/tuple/iterator, this method returns
|
If argument is empty list/tuple/iterator, this method returns
|
||||||
None. If argument is coverted into a list with a
|
None. If argument is converted into a list with a
|
||||||
single ``Failure`` object in it, that failure is reraised. Else, a
|
single ``Failure`` object in it, that failure is reraised. Else, a
|
||||||
:class:`~taskflow.exceptions.WrappedFailure` exception
|
:class:`~taskflow.exceptions.WrappedFailure` exception
|
||||||
is raised with the failure list as causes.
|
is raised with the failure list as causes.
|
||||||
@@ -378,9 +378,9 @@ class Failure(mixins.StrMixin):
|
|||||||
#
|
#
|
||||||
# See: https://www.python.org/dev/peps/pep-0415/ for why/what
|
# See: https://www.python.org/dev/peps/pep-0415/ for why/what
|
||||||
# the '__suppress_context__' is/means/implies...
|
# the '__suppress_context__' is/means/implies...
|
||||||
supress_context = getattr(exc_val,
|
suppress_context = getattr(exc_val,
|
||||||
'__suppress_context__', False)
|
'__suppress_context__', False)
|
||||||
if supress_context:
|
if suppress_context:
|
||||||
attr_lookups = ['__cause__']
|
attr_lookups = ['__cause__']
|
||||||
else:
|
else:
|
||||||
attr_lookups = ['__cause__', '__context__']
|
attr_lookups = ['__cause__', '__context__']
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ class Notifier(object):
|
|||||||
into :py:meth:`.register` or :py:meth:`.reset` at the same time could
|
into :py:meth:`.register` or :py:meth:`.reset` at the same time could
|
||||||
potentially end badly. It is thread-safe when
|
potentially end badly. It is thread-safe when
|
||||||
only :py:meth:`.notify` calls or other read-only actions (like calling
|
only :py:meth:`.notify` calls or other read-only actions (like calling
|
||||||
into :py:meth:`.is_registered`) are occuring at the same time.
|
into :py:meth:`.is_registered`) are occurring at the same time.
|
||||||
|
|
||||||
.. _pub/sub: http://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern
|
.. _pub/sub: http://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern
|
||||||
"""
|
"""
|
||||||
@@ -145,7 +145,7 @@ class Notifier(object):
|
|||||||
#: Keys that can *not* be used in callbacks arguments
|
#: Keys that can *not* be used in callbacks arguments
|
||||||
RESERVED_KEYS = ('details',)
|
RESERVED_KEYS = ('details',)
|
||||||
|
|
||||||
#: Kleene star constant that is used to recieve all notifications
|
#: Kleene star constant that is used to receive all notifications
|
||||||
ANY = '*'
|
ANY = '*'
|
||||||
|
|
||||||
#: Events which can *not* be used to trigger notifications
|
#: Events which can *not* be used to trigger notifications
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ class Node(object):
|
|||||||
def disassociate(self):
|
def disassociate(self):
|
||||||
"""Removes this node from its parent (if any).
|
"""Removes this node from its parent (if any).
|
||||||
|
|
||||||
:returns: occurences of this node that were removed from its parent.
|
:returns: occurrences of this node that were removed from its parent.
|
||||||
"""
|
"""
|
||||||
occurrences = 0
|
occurrences = 0
|
||||||
if self.parent is not None:
|
if self.parent is not None:
|
||||||
|
|||||||
Reference in New Issue
Block a user