[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/wfmc/ Fixing up
interfaces.
Benji York
benji at zope.com
Fri Jan 21 15:21:44 EST 2005
Log message for revision 28909:
Fixing up interfaces.
Changed:
U Zope3/trunk/src/zope/app/wfmc/tests.py
U Zope3/trunk/src/zope/app/wfmc/zcml.py
U Zope3/trunk/src/zope/app/wfmc/zcml.txt
-=-
Modified: Zope3/trunk/src/zope/app/wfmc/tests.py
===================================================================
--- Zope3/trunk/src/zope/app/wfmc/tests.py 2005-01-21 20:15:23 UTC (rev 28908)
+++ Zope3/trunk/src/zope/app/wfmc/tests.py 2005-01-21 20:21:44 UTC (rev 28909)
@@ -1,7 +1,3 @@
-"""
-
-$Id: $
-"""
import os
import unittest
Modified: Zope3/trunk/src/zope/app/wfmc/zcml.py
===================================================================
--- Zope3/trunk/src/zope/app/wfmc/zcml.py 2005-01-21 20:15:23 UTC (rev 28908)
+++ Zope3/trunk/src/zope/app/wfmc/zcml.py 2005-01-21 20:21:44 UTC (rev 28909)
@@ -1,8 +1,5 @@
-"""ZCML directives for defining privileges.
+"""ZCML directives for defining privileges."""
-$Id: $
-"""
-
import zope.interface
import zope.schema
import zope.configuration.fields
@@ -14,38 +11,33 @@
class IdefineXpdl(zope.interface.Interface):
- file = zope.configuration.fields.MessageID(
+ file = zope.configuration.fields.Path(
title=u"File Name",
description=u"The name of the xpdl file to read.",
)
- process = zope.configuration.fields.MessageID(
+ process = zope.schema.TextLine(
title=u"Process Name",
description=u"The name of the process to read.",
)
- id = zope.configuration.fields.MessageID(
+ id = zope.schema.Id(
title=u"ID",
description=(u"The identifier to use for the process. "
u"Defaults to the process name."),
- required=False,
)
-def createUtility(file, process, id, info=None):
- # XXX should I use info for something?
+def createUtility(file, process, id):
package = xpdl.read(open(file))
definition = package[process]
definition.id = id
zapi.getGlobalService('Utilities').provideUtility(
- wfmc.interfaces.IProcessDefinition, definition, definition.id)
+ wfmc.interfaces.IProcessDefinition, definition, id)
-def defineXpdl(_context, file, process, id=None):
- if not id:
- id = process
-
+def defineXpdl(_context, file, process, id):
_context.action(
discriminator=('intranet:xpdl', id),
callable=createUtility,
- args=(file, process, id, _context.info),
+ args=(file, process, id),
)
Modified: Zope3/trunk/src/zope/app/wfmc/zcml.txt
===================================================================
--- Zope3/trunk/src/zope/app/wfmc/zcml.txt 2005-01-21 20:15:23 UTC (rev 28908)
+++ Zope3/trunk/src/zope/app/wfmc/zcml.txt 2005-01-21 20:21:44 UTC (rev 28909)
@@ -12,8 +12,12 @@
... i18n_domain="test"
... >
...
- ... <wfmc:xpdl file="%(file_name)s" process="Publication" />
- ... <wfmc:xpdl file="%(file_name)s" process="Publication" id="Pub"/>
+ ... <wfmc:xpdl
+ ... file="%(file_name)s"
+ ... process="Publication"
+ ... id="example.publication"
+ ... />
+ ...
... </configure>
... """ % locals())
@@ -21,7 +25,5 @@
>>> from zope.wfmc.interfaces import IProcessDefinition
>>> import zope.component
- >>> zope.component.getUtility(IProcessDefinition, 'Publication')
- ProcessDefinition(u'Publication')
- >>> zope.component.getUtility(IProcessDefinition, 'Pub')
- ProcessDefinition(u'Pub')
+ >>> zope.component.getUtility(IProcessDefinition, 'example.publication')
+ ProcessDefinition('example.publication')
More information about the Zope3-Checkins
mailing list