[Zope3-checkins] SVN: Zope3/trunk/src/zope/wfmc/process.py Developed nicer, human-readable representations of several classes. Hope

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Jul 26 16:29:50 EDT 2005


Log message for revision 37434:
  Developed nicer, human-readable representations of several classes. Hope 
  you like it! :-)
  
  

Changed:
  U   Zope3/trunk/src/zope/wfmc/process.py

-=-
Modified: Zope3/trunk/src/zope/wfmc/process.py
===================================================================
--- Zope3/trunk/src/zope/wfmc/process.py	2005-07-26 20:22:04 UTC (rev 37433)
+++ Zope3/trunk/src/zope/wfmc/process.py	2005-07-26 20:29:49 UTC (rev 37434)
@@ -162,6 +162,10 @@
                     self.outgoing += (transition,)                    
         else:
             self.outgoing = self.transition_outgoing
+
+    def __repr__(self):
+        return "<ActivityDefinition '%s'>" %self.__name__
+
         
 def always_true(data):
     return True
@@ -176,6 +180,9 @@
         self.to = to
         self.condition = condition
 
+    def __repr__(self):
+        return "TransitionDefinition(from='%s', to='%s')" %(self.from_, self.to)
+
         
 class Process(persistent.Persistent):
 
@@ -463,9 +470,21 @@
     def defineParameters(self, *parameters):
         self.parameters += parameters
 
+    def __repr__(self):
+        input = ', '.join([param.__name__ for param in self.parameters
+                           if param.input == True])
+        output = ', '.join([param.__name__ for param in self.parameters
+                           if param.output == True])        
+        return "<Application '%s': (%s) --> (%s)>" %(self.__name__,
+                                                     input, output)
+        
+
 class Participant:
 
     interface.implements(interfaces.IParticipantDefinition)
 
     def __init__(self, name=None):
         self.__name__ = name
+
+    def __repr__(self):
+        return "Participant('%s')" %self.__name__



More information about the Zope3-Checkins mailing list