Fix two minor bugs in docs/examples
+ taskflow path in sys.path + listener => notifier Change-Id: I0a657540571f9862e2adea5a40d03dfa3ce90e2b
This commit is contained in:
@@ -4,13 +4,11 @@ import sys
|
|||||||
|
|
||||||
logging.basicConfig(level=logging.ERROR)
|
logging.basicConfig(level=logging.ERROR)
|
||||||
|
|
||||||
if not os.path.isfile(os.path.join(os.getcwd(), "taskflow", '__init__.py')):
|
my_dir_path = os.path.dirname(os.path.abspath(__file__))
|
||||||
sys.path.insert(0, os.path.join(os.path.abspath(os.getcwd()), os.pardir))
|
sys.path.insert(0, os.path.join(os.path.join(my_dir_path, os.pardir),
|
||||||
else:
|
os.pardir))
|
||||||
sys.path.insert(0, os.path.abspath(os.getcwd()))
|
|
||||||
|
|
||||||
from taskflow import decorators
|
from taskflow import decorators
|
||||||
|
|
||||||
from taskflow.patterns import linear_flow as lf
|
from taskflow.patterns import linear_flow as lf
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,9 @@ import sys
|
|||||||
|
|
||||||
logging.basicConfig(level=logging.ERROR)
|
logging.basicConfig(level=logging.ERROR)
|
||||||
|
|
||||||
if not os.path.isfile(os.path.join(os.getcwd(), "taskflow", '__init__.py')):
|
my_dir_path = os.path.dirname(os.path.abspath(__file__))
|
||||||
sys.path.insert(0, os.path.join(os.path.abspath(os.getcwd()), os.pardir))
|
sys.path.insert(0, os.path.join(os.path.join(my_dir_path, os.pardir),
|
||||||
else:
|
os.pardir))
|
||||||
sys.path.insert(0, os.path.abspath(os.getcwd()))
|
|
||||||
|
|
||||||
from taskflow.patterns import linear_flow as lf
|
from taskflow.patterns import linear_flow as lf
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,9 @@ import sys
|
|||||||
|
|
||||||
logging.basicConfig(level=logging.ERROR)
|
logging.basicConfig(level=logging.ERROR)
|
||||||
|
|
||||||
if not os.path.isfile(os.path.join(os.getcwd(), "taskflow", '__init__.py')):
|
my_dir_path = os.path.dirname(os.path.abspath(__file__))
|
||||||
sys.path.insert(0, os.path.join(os.path.abspath(os.getcwd()), os.pardir))
|
sys.path.insert(0, os.path.join(os.path.join(my_dir_path, os.pardir),
|
||||||
else:
|
os.pardir))
|
||||||
sys.path.insert(0, os.path.abspath(os.getcwd()))
|
|
||||||
|
|
||||||
from taskflow.patterns import linear_flow as lf
|
from taskflow.patterns import linear_flow as lf
|
||||||
|
|
||||||
@@ -33,8 +32,8 @@ def task_watch(context, state, flow, task, result=None):
|
|||||||
flow = lf.Flow("call-them")
|
flow = lf.Flow("call-them")
|
||||||
flow.add(call_jim)
|
flow.add(call_jim)
|
||||||
flow.add(call_joe)
|
flow.add(call_joe)
|
||||||
flow.task_listeners.append(task_watch)
|
flow.task_notifier.register('*', task_watch)
|
||||||
flow.listeners.append(flow_watch)
|
flow.notifier.register('*', flow_watch)
|
||||||
|
|
||||||
context = {
|
context = {
|
||||||
"joe_number": 444,
|
"joe_number": 444,
|
||||||
|
|||||||
Reference in New Issue
Block a user