[Zope3-checkins] CVS: Zope3/src/zope/app/workflow -
definition.py:1.3.24.1 instance.py:1.7.6.1 service.py:1.9.10.1
Jim Fulton
jim at zope.com
Mon Sep 8 15:22:24 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/workflow
In directory cvs.zope.org:/tmp/cvs-serv20092/src/zope/app/workflow
Modified Files:
Tag: parentgeddon-branch
definition.py instance.py service.py
Log Message:
Checking in work in progress on parentgeddon-branch so Fred can help
me to get the tests passing. Specific log entries will be provided
when we merge this into the head.
=== Zope3/src/zope/app/workflow/definition.py 1.3 => 1.3.24.1 ===
--- Zope3/src/zope/app/workflow/definition.py:1.3 Fri Jun 6 12:34:53 2003
+++ Zope3/src/zope/app/workflow/definition.py Mon Sep 8 14:21:53 2003
@@ -20,10 +20,10 @@
from types import StringTypes
from persistence import Persistent
from persistence.dict import PersistentDict
-from zope.context import ContextMethod, getWrapperContainer
-from zope.app.interfaces.workflow \
- import IProcessDefinition, IProcessDefinitionElementContainer
+from zope.app.interfaces.workflow import IProcessDefinitionElementContainer
+from zope.app.interfaces.workflow import IProcessDefinition
from zope.interface import implements
+from zope.app.container.contained import Contained
class ProcessDefinition(Persistent):
@@ -47,7 +47,7 @@
-class ProcessDefinitionElementContainer(Persistent):
+class ProcessDefinitionElementContainer(Persistent, Contained):
""" See IProcessDefinitionElementContainer.
"""
@@ -113,5 +113,4 @@
del self.__data[key]
def getProcessDefinition(self):
- return getWrapperContainer(self)
- getProcessDefinition = ContextMethod(getProcessDefinition)
+ return self.__parent__
=== Zope3/src/zope/app/workflow/instance.py 1.7 => 1.7.6.1 ===
--- Zope3/src/zope/app/workflow/instance.py:1.7 Fri Aug 15 20:44:31 2003
+++ Zope3/src/zope/app/workflow/instance.py Mon Sep 8 14:21:53 2003
@@ -19,7 +19,6 @@
from types import StringTypes
from persistence.dict import PersistentDict
-from zope.app.context import ContextWrapper
from zope.proxy import removeAllProxies
from zope.app.interfaces.annotation import IAnnotatable, IAnnotations
@@ -76,13 +75,13 @@
def __getitem__(self, key):
"See IProcessInstanceContainer"
value = self.wfdata[key]
- return ContextWrapper(value, self.context, name=key)
+ return value
def get(self, key, default=None):
"See IProcessInstanceContainer"
value = self.wfdata.get(key, _marker)
if value is not _marker:
- return ContextWrapper(value, self.context, name=key)
+ return value
else:
return default
@@ -92,11 +91,7 @@
def values(self):
"See IProcessInstanceContainer"
- container = self.wfdata
- result = []
- for key, value in container.items():
- result.append(ContextWrapper(value, self.context, name=key))
- return result
+ return self.wfdata.values()
def keys(self):
"See IProcessInstanceContainer"
@@ -108,11 +103,7 @@
def items(self):
"See IProcessInstanceContainer"
- container = self.wfdata
- result = []
- for key, value in container.items():
- result.append((key, ContextWrapper(value, self.context, name=key)))
- return result
+ return self.wfdata.items()
def setObject(self, key, object):
"See IProcessInstanceContainer"
=== Zope3/src/zope/app/workflow/service.py 1.9 => 1.9.10.1 ===
--- Zope3/src/zope/app/workflow/service.py:1.9 Tue Jul 29 20:00:22 2003
+++ Zope3/src/zope/app/workflow/service.py Mon Sep 8 14:21:53 2003
@@ -21,7 +21,6 @@
from persistence import Persistent
from zope.component import getService
from zope.app.component.nextservice import queryNextService
-from zope.app.context import ContextWrapper
from zope.app.interfaces.services.registration import INameComponentRegistry
from zope.app.interfaces.services.registration import IRegistered
from zope.app.interfaces.services.service import ISimpleService
@@ -33,7 +32,7 @@
from zope.app.services.servicenames import Workflows
from zope.app.traversing import getPath
from zope.component import getAdapter
-from zope.context import ContextMethod
+from zope.app.container.contained import Contained
from zope.interface import implements
from zope.schema.interfaces import \
ITokenizedTerm, IVocabulary, IVocabularyTokenized
@@ -44,7 +43,7 @@
"""
-class WorkflowService(Persistent, NameComponentRegistry):
+class WorkflowService(Persistent, NameComponentRegistry, Contained):
__doc__ = IWorkflowService.__doc__
@@ -67,7 +66,6 @@
definition_names[name] = 0
return definition_names.keys()
- getProcessDefinitionNames = ContextMethod(getProcessDefinitionNames)
@@ -75,13 +73,12 @@
'See IWorkflowService'
pd = self.queryActiveComponent(name)
if pd is not None:
- return ContextWrapper(pd, self, name=name)
+ return pd
service = queryNextService(self, Workflows)
if service is not None:
return service.getProcessDefinition(name)
raise KeyError, name
- getProcessDefinition = ContextMethod(getProcessDefinition)
def queryProcessDefinition(self, name, default=None):
@@ -91,14 +88,12 @@
except KeyError:
return default
- queryProcessDefinition = ContextMethod(queryProcessDefinition)
def createProcessInstance(self, definition_name):
pd = self.getProcessDefinition(definition_name)
return pd.createProcessInstance(definition_name)
- createProcessInstance = ContextMethod(createProcessInstance)
#
############################################################
More information about the Zope3-Checkins
mailing list