[Zope3-checkins] CVS: Zope3/src/zope/app/workflow/browser/stateful - instance.py:1.4

Jim Fulton jim at zope.com
Sat Mar 6 11:51:07 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/workflow/browser/stateful
In directory cvs.zope.org:/tmp/cvs-serv11249/src/zope/app/workflow/browser/stateful

Modified Files:
	instance.py 
Log Message:
Converted most getAdapter calls to use interface calls instead.


=== Zope3/src/zope/app/workflow/browser/stateful/instance.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/workflow/browser/stateful/instance.py:1.3	Fri Mar  5 23:17:26 2004
+++ Zope3/src/zope/app/workflow/browser/stateful/instance.py	Sat Mar  6 11:50:36 2004
@@ -15,7 +15,7 @@
  
 $Id$
 """
-from zope.component import getAdapter, getService
+from zope.component import getService
 from zope.proxy import removeAllProxies
 from zope.publisher.browser import BrowserView
 from zope.security.proxy import trustedRemoveSecurityProxy
@@ -60,7 +60,7 @@
 
     def listContentInfo(self):
         return map(self._extractContentInfo,
-                   getAdapter(self.context, IProcessInstanceContainer).items())
+                   IProcessInstanceContainer(self.context).items())
 
     def getWorkflowTitle(self):
         pi = self._getSelWorkflow()
@@ -79,14 +79,14 @@
         clean_pd = removeAllProxies(pd)
 
         current_state = clean_pd.getState(pi.status)
-        adapter = getAdapter(current_state, IZopeDublinCore)
+        adapter = IZopeDublinCore(current_state)
         info['status'] = adapter.title or pi.status
 
         transition_names = pi.getOutgoingTransitions()
         trans_info = []
         for name in transition_names:
             transition = clean_pd.getTransition(name)
-            adapter = getAdapter(transition, IZopeDublinCore)
+            adapter = IZopeDublinCore(transition)
             trans_info.append({'name':name,
                                'title': adapter.title or name})
         info['transitions'] = trans_info
@@ -105,12 +105,12 @@
 
 
     def _getTitle(self, obj):
-        return (getAdapter(obj, IZopeDublinCore).title or obj.__name___)
+        return (IZopeDublinCore(obj).title or obj.__name___)
 
  
     def _getSelWorkflow(self):
         reqWorkflow = self.request.get('workflow', u'')
-        pi_container = getAdapter(self.context, IProcessInstanceContainer)
+        pi_container = IProcessInstanceContainer(self.context)
         if reqWorkflow is u'':
             available_instances = pi_container.keys()
             if len(available_instances) > 0:




More information about the Zope3-Checkins mailing list