Author: jmorliaguet
Date: Sat Nov  5 10:22:34 2005
New Revision: 29008

Modified:
   z3lab/z3ecm/trunk/src/ecm/cpsskins/README.txt
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example6/configure.zcml
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example6/counter.py
Log:

- API update



Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/README.txt
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/README.txt       (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/README.txt       Sat Nov  5 10:22:34 2005
@@ -7,6 +7,8 @@
 
 :Author: Jean-Marc Orliaguet
 :Version: $Revision: 4 $
+:Web site: http://www.medic.chalmers.se/~jmo/Zope3/ecm/cpsskins/README.html
+:Source: https://svn.nuxeo.org/pub/z3lab/z3ecm/trunk/src/ecm/cpsskins
 :Copyright: 2005 Nuxeo and Contributors.
 
 .. contents::

Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/example6/configure.zcml
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/example6/configure.zcml  (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example6/configure.zcml  Sat Nov  5 
10:22:34 2005
@@ -16,8 +16,4 @@
       icon="counter-icon.png"
   />
 
-  <adapter
-      factory=".counter.CounterUpdater"
-  />
-
 </configure>

Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/example6/counter.py
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/example6/counter.py      (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example6/counter.py      Sat Nov  5 
10:22:34 2005
@@ -33,7 +33,7 @@
 class CounterPortlet(Portlet):
     """The Counter portlet increments a counter before being displayed.
     """
-    implements(ICounterPortlet)
+    implements(ICounterPortlet, IUpdateData)
 
     def __init__(self, title=u''):
         self.title = title
@@ -43,18 +43,7 @@
         count = request.annotations.get(COUNTER_NAME, 0)
         return u"There are <b>%s</b> portlet(s) on this page." % str(count)
 
-class CounterUpdater(object):
-    """This adapter is called when the portlet is updated.
-
-    It increments the counter by 1.
-    """
-    adapts(ICounterPortlet)
-    implements(IUpdateData)
-
-    def __init__(self, context):
-        self.context = context
-
-    def __call__(self, info):
+    def update(self, info):
         request = info.globals.request
 
         if COUNTER_NAME not in request.annotations:
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to