futurize stage 1

This commit is contained in:
Samuel Abels
2017-03-23 06:53:27 +01:00
parent b495594b65
commit 09a33a4221
8 changed files with 13 additions and 6 deletions

View File

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import division, absolute_import
from __future__ import print_function
# Copyright (C) 2012 Matthew Hampton
#
# This library is free software; you can redistribute it and/or

View File

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import division, absolute_import
from __future__ import print_function
# Copyright (C) 2007 Samuel Abels
#
# This library is free software; you can redistribute it and/or

View File

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import division, absolute_import
from __future__ import print_function
# Copyright (C) 2007 Samuel Abels
#
# This library is free software; you can redistribute it and/or
@ -386,7 +387,7 @@ class TaskSpec(object):
assert my_task is not None
if my_task.workflow.debug:
print("Executing task:", my_task.get_name())
print(("Executing task:", my_task.get_name()))
self._on_complete_hook(my_task)

View File

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import division, absolute_import
from __future__ import print_function
# Copyright (C) 2007 Samuel Abels
#
# This library is free software; you can redistribute it and/or

View File

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import division, absolute_import
from __future__ import print_function
# Copyright (C) 2007 Samuel Abels
#
# This library is free software; you can redistribute it and/or
@ -86,7 +87,7 @@ class Workflow(object):
mask = Task.NOT_FINISHED_MASK
iter = Task.Iterator(self.task_tree, mask)
try:
iter.next()
next(iter)
except:
# No waiting tasks found.
return True
@ -223,7 +224,7 @@ class Workflow(object):
if pick_up and self.last_task is not None:
try:
iter = Task.Iterator(self.last_task, Task.READY)
next = iter.next()
next = next(iter)
except:
next = None
self.last_task = None

View File

@ -1,8 +1,9 @@
from __future__ import print_function
from SpiffWorkflow.specs import Simple
class NuclearStrike(Simple):
def _on_complete_hook(self, my_task):
print(self.my_variable, "sent!")
print((self.my_variable, "sent!"))
def serialize(self, serializer):
return serializer.serialize_nuclear_strike(self)

View File

@ -1,8 +1,9 @@
from __future__ import print_function
from SpiffWorkflow.specs import WorkflowSpec, ExclusiveChoice, Simple, Cancel
from SpiffWorkflow.operators import Equal, Attrib
def my_nuclear_strike(msg):
print "Launched:", msg
print("Launched:", msg)
class NuclearStrikeWorkflowSpec(WorkflowSpec):
def __init__(self):

View File

@ -20,7 +20,7 @@ included with the package.
author_email = 'cheeseshop.python.org@debain.org',
license = 'lGPLv2',
packages = find_packages(exclude=['tests', 'tests.*']),
install_requires = ['lxml'],
install_requires = ['future', 'configparser', 'lxml'],
keywords = 'spiff workflow bpmn engine',
url = 'https://github.com/knipknap/SpiffWorkflow',
classifiers = [