[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/wfmc/ Restructured to match idiomatic conventions. Added ID fields.

Benji York benji at zope.com
Fri Jan 21 15:49:22 EST 2005


Log message for revision 28910:
  Restructured to match idiomatic conventions. Added ID fields.

Changed:
  U   Zope3/trunk/src/zope/app/wfmc/meta.zcml
  A   Zope3/trunk/src/zope/app/wfmc/metaconfigure.py
  A   Zope3/trunk/src/zope/app/wfmc/metadirectives.py
  U   Zope3/trunk/src/zope/app/wfmc/tests.py
  D   Zope3/trunk/src/zope/app/wfmc/zcml.py

-=-
Modified: Zope3/trunk/src/zope/app/wfmc/meta.zcml
===================================================================
--- Zope3/trunk/src/zope/app/wfmc/meta.zcml	2005-01-21 20:21:44 UTC (rev 28909)
+++ Zope3/trunk/src/zope/app/wfmc/meta.zcml	2005-01-21 20:49:21 UTC (rev 28910)
@@ -3,7 +3,7 @@
 
   <meta:directive namespace="http://namespaces.zope.com/wfmc"
                   name="xpdl"
-                  schema=".zcml.IdefineXpdl"
-                  handler=".zcml.defineXpdl" />
+                  schema=".metadirectives.IdefineXpdl"
+                  handler=".metaconfigure.defineXpdl" />
 
 </configure>

Added: Zope3/trunk/src/zope/app/wfmc/metaconfigure.py
===================================================================
--- Zope3/trunk/src/zope/app/wfmc/metaconfigure.py	2005-01-21 20:21:44 UTC (rev 28909)
+++ Zope3/trunk/src/zope/app/wfmc/metaconfigure.py	2005-01-21 20:49:21 UTC (rev 28910)
@@ -0,0 +1,28 @@
+"""WFMC metaconfigure
+
+$Id: $
+"""
+
+import zope.interface
+import zope.schema
+import zope.configuration.fields
+import zope.component
+
+from zope.app import zapi
+from zope import wfmc
+from zope.wfmc import xpdl
+
+def createUtility(file, process, id):
+    package = xpdl.read(open(file))
+    definition = package[process]
+    definition.id = id
+
+    zapi.getGlobalService('Utilities').provideUtility(
+            wfmc.interfaces.IProcessDefinition, definition, id)
+
+def defineXpdl(_context, file, process, id):
+    _context.action(
+        discriminator=('intranet:xpdl', id),
+        callable=createUtility, 
+        args=(file, process, id),
+        )

Added: Zope3/trunk/src/zope/app/wfmc/metadirectives.py
===================================================================
--- Zope3/trunk/src/zope/app/wfmc/metadirectives.py	2005-01-21 20:21:44 UTC (rev 28909)
+++ Zope3/trunk/src/zope/app/wfmc/metadirectives.py	2005-01-21 20:49:21 UTC (rev 28910)
@@ -0,0 +1,26 @@
+"""ZCML directives for defining privileges.
+
+$Id: $
+"""
+
+import zope.interface
+import zope.schema
+import zope.configuration.fields
+
+class IdefineXpdl(zope.interface.Interface):
+
+    file = zope.configuration.fields.Path(
+        title=u"File Name",
+        description=u"The name of the xpdl file to read.",
+        )
+
+    process = zope.schema.TextLine(
+        title=u"Process Name",
+        description=u"The name of the process to read.",
+        )
+
+    id = zope.schema.Id(
+        title=u"ID",
+        description=(u"The identifier to use for the process.  "
+                     u"Defaults to the process name."),
+        )

Modified: Zope3/trunk/src/zope/app/wfmc/tests.py
===================================================================
--- Zope3/trunk/src/zope/app/wfmc/tests.py	2005-01-21 20:21:44 UTC (rev 28909)
+++ Zope3/trunk/src/zope/app/wfmc/tests.py	2005-01-21 20:49:21 UTC (rev 28910)
@@ -1,3 +1,6 @@
+"""
+$Id: $
+"""
 import os
 import unittest
 

Deleted: Zope3/trunk/src/zope/app/wfmc/zcml.py
===================================================================
--- Zope3/trunk/src/zope/app/wfmc/zcml.py	2005-01-21 20:21:44 UTC (rev 28909)
+++ Zope3/trunk/src/zope/app/wfmc/zcml.py	2005-01-21 20:49:21 UTC (rev 28910)
@@ -1,43 +0,0 @@
-"""ZCML directives for defining privileges."""
-
-import zope.interface
-import zope.schema
-import zope.configuration.fields
-import zope.component
-
-from zope.app import zapi
-from zope import wfmc
-from zope.wfmc import xpdl
-
-class IdefineXpdl(zope.interface.Interface):
-
-    file = zope.configuration.fields.Path(
-        title=u"File Name",
-        description=u"The name of the xpdl file to read.",
-        )
-
-    process = zope.schema.TextLine(
-        title=u"Process Name",
-        description=u"The name of the process to read.",
-        )
-
-    id = zope.schema.Id(
-        title=u"ID",
-        description=(u"The identifier to use for the process.  "
-                     u"Defaults to the process name."),
-        )
-
-def createUtility(file, process, id):
-    package = xpdl.read(open(file))
-    definition = package[process]
-    definition.id = id
-
-    zapi.getGlobalService('Utilities').provideUtility(
-            wfmc.interfaces.IProcessDefinition, definition, id)
-
-def defineXpdl(_context, file, process, id):
-    _context.action(
-        discriminator=('intranet:xpdl', id),
-        callable=createUtility, 
-        args=(file, process, id),
-        )



More information about the Zope3-Checkins mailing list