[Zope3-checkins] CVS: Zope3/src/zope/app/workflow/stateful -
instance.py:1.18
Stephan Richter
srichter at cosmos.phy.tufts.edu
Thu Apr 15 18:11:34 EDT 2004
Update of /cvs-repository/Zope3/src/zope/app/workflow/stateful
In directory cvs.zope.org:/tmp/cvs-serv9027/src/zope/app/workflow/stateful
Modified Files:
instance.py
Log Message:
Got rid of workflow service.
Use zapi.
=== Zope3/src/zope/app/workflow/stateful/instance.py 1.17 => 1.18 ===
--- Zope3/src/zope/app/workflow/stateful/instance.py:1.17 Fri Feb 27 11:50:40 2004
+++ Zope3/src/zope/app/workflow/stateful/instance.py Thu Apr 15 18:11:34 2004
@@ -15,25 +15,25 @@
$Id$
"""
-__metaclass__ = type
-
from persistent import Persistent
from persistent.dict import PersistentDict
from zope.app import zapi
from zope.app.event import publish
+from zope.app.workflow.interfaces import IProcessDefinition
from zope.app.workflow.interfaces.stateful import AUTOMATIC
from zope.app.workflow.interfaces.stateful import IAfterTransitionEvent
from zope.app.workflow.interfaces.stateful import IBeforeTransitionEvent
from zope.app.workflow.interfaces.stateful import IRelevantDataChangeEvent
from zope.app.workflow.interfaces.stateful import IStatefulProcessInstance
from zope.app.workflow.interfaces.stateful import ITransitionEvent
-from zope.app.workflow.interfaces.stateful import \
- IBeforeRelevantDataChangeEvent, IAfterRelevantDataChangeEvent
+from zope.app.workflow.interfaces.stateful import IBeforeRelevantDataChangeEvent
+from zope.app.workflow.interfaces.stateful import IAfterRelevantDataChangeEvent
+from zope.app.servicenames import Utilities
from zope.app.traversing import getParent
from zope.app.workflow.instance import ProcessInstance
-from zope.component import getService, getServiceManager
from zope.app.container.contained import Contained
+
from zope.exceptions import Unauthorized
from zope.interface import directlyProvides, implements
from zope.proxy import removeAllProxies
@@ -44,7 +44,7 @@
from zope.tales.engine import Engine
-class TransitionEvent:
+class TransitionEvent(object):
"""A simple implementation of the transition event."""
implements(ITransitionEvent)
@@ -60,7 +60,7 @@
implements(IAfterTransitionEvent)
-class RelevantDataChangeEvent:
+class RelevantDataChangeEvent(object):
"""A simple implementation of the transition event."""
implements(IRelevantDataChangeEvent)
@@ -142,7 +142,7 @@
return self.__schema
-class StateChangeInfo:
+class StateChangeInfo(object):
"""Immutable StateChangeInfo."""
def __init__(self, transition):
@@ -216,8 +216,8 @@
def getProcessDefinition(self):
"""Get the ProcessDefinition object from WorkflowService."""
- svc = getService(self, "Workflows")
- return svc.getProcessDefinition(self.processDefinitionName)
+ utils = zapi.getService(self, Utilities)
+ return utils.getUtility(IProcessDefinition, self.processDefinitionName)
# XXX this is not entirely tested
def _getContext(self):
@@ -268,7 +268,7 @@
if not script:
return True
if isinstance(script, (str, unicode)):
- sm = getServiceManager(self)
+ sm = zapi.getServiceManager(self)
script = sm.resolve(script)
return script(contexts)
More information about the Zope3-Checkins
mailing list