[Zope3-checkins] CVS: Products3/zwiki/renderer - plaintext.py:1.3 rest.py:1.4 stx.py:1.4

Stephan Richter srichter@cbu.edu
Thu, 5 Jun 2003 09:34:56 -0400


Update of /cvs-repository/Products3/zwiki/renderer
In directory cvs.zope.org:/tmp/cvs-serv27908/src/zopeproducts/zwiki/renderer

Modified Files:
	plaintext.py rest.py stx.py 
Log Message:
Updated the Zwiki Product to reflect recent API changes:

- Moved all __implements__ statements to implements()

- Moved zope.context.ContextWrapper to zope.app.context.ContextWrapper

- Moved zope.proxy.introspection.removeAllProxies to 
  zope.proxy.removeAllProxies

- Added a few comments

- Fixed tests

XXX: We still do not have a method for __used_for__; what should I use in
     this case?


=== Products3/zwiki/renderer/plaintext.py 1.2 => 1.3 ===
--- Products3/zwiki/renderer/plaintext.py:1.2	Sat Apr 12 19:05:34 2003
+++ Products3/zwiki/renderer/plaintext.py	Thu Jun  5 09:34:25 2003
@@ -15,12 +15,14 @@
 
 $Id$
 """
+from zope.interface import implements
 from zopeproducts.zwiki.interfaces import IPlainTextSource, IHTMLRenderer
 from zope.publisher.browser import BrowserView
 
 
 class PlainTextSource(unicode):
-    __implements__ = IPlainTextSource
+    """Represents Plain Text source code""" 
+    implements(IPlainTextSource)
 
     def createComment(self, comment, number, user, date):
         "See zopeproducts.zwiki.interfaces.IPlainTextSource"
@@ -31,7 +33,8 @@
     
 
 class PlainTextToHTMLRenderer(BrowserView):
-    __implements__ = BrowserView.__implements__, IHTMLRenderer
+    """An Adapter to convert from Plain Text to HTML.""" 
+    implements(IHTMLRenderer)
     __used_for__ = IPlainTextSource
 
     def render(self, context):


=== Products3/zwiki/renderer/rest.py 1.3 => 1.4 ===
--- Products3/zwiki/renderer/rest.py:1.3	Sat Apr 12 19:05:34 2003
+++ Products3/zwiki/renderer/rest.py	Thu Jun  5 09:34:25 2003
@@ -22,6 +22,7 @@
     docutils = None
 
 from datetime import datetime
+from zope.interface import implements
 from zope.publisher.browser import BrowserView
 from zopeproducts.zwiki.interfaces import \
      IReStructuredTextSource, IHTMLRenderer
@@ -29,7 +30,8 @@
 
 
 class ReStructuredTextSource(unicode):
-    __implements__ = IReStructuredTextSource
+    """Represents Restructured Text source code""" 
+    implements(IReStructuredTextSource)
 
     def createComment(self, comment, number, user, date):
         "See zopeproducts.zwiki.interfaces.IReStructuredTextSource"
@@ -40,7 +42,8 @@
 
 
 class ReStructuredTextToHTMLRenderer(BrowserView):
-    __implements__ = BrowserView.__implements__, IHTMLRenderer
+    """An Adapter to convert from Restructured Text to HTML.""" 
+    implements(IHTMLRenderer)
     __used_for__ = IReStructuredTextSource
 
     def render(self, context):


=== Products3/zwiki/renderer/stx.py 1.3 => 1.4 ===
--- Products3/zwiki/renderer/stx.py:1.3	Sat Apr 12 19:05:34 2003
+++ Products3/zwiki/renderer/stx.py	Thu Jun  5 09:34:25 2003
@@ -18,6 +18,7 @@
 import re
 
 from datetime import datetime
+from zope.interface import implements
 from zope.publisher.browser import BrowserView
 from zopeproducts.zwiki.interfaces import IStructuredTextSource, IHTMLRenderer
 
@@ -25,7 +26,8 @@
 
 
 class StructuredTextSource(unicode):
-    __implements__ = IStructuredTextSource
+    """Represents Structured Text source code""" 
+    implements(IStructuredTextSource)
 
     def createComment(self, comment, number, user, date):
         "See zopeproducts.zwiki.interfaces.IStructuredTextSource"
@@ -36,7 +38,8 @@
     
 
 class StructuredTextToHTMLRenderer(BrowserView):
-    __implements__ = BrowserView.__implements__, IHTMLRenderer
+    """An Adapter to convert from Plain Text to HTML.""" 
+    implements(IHTMLRenderer)
     __used_for__ = IStructuredTextSource
 
     def render(self, context):