[Zope3-checkins] SVN: Zope3/branches/philikon-reduce-zcml/src/zope/app/ Remove usage of <factory />.

Philipp von Weitershausen philikon at philikon.de
Sat Feb 25 15:49:33 EST 2006


Log message for revision 65476:
  Remove usage of <factory />.
  

Changed:
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/demo/insensitivefolder/__init__.py
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/demo/insensitivefolder/configure.zcml
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/configure.zcml
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/plaintext.py
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/rest.py
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/stx.py

-=-
Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/demo/insensitivefolder/__init__.py
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/demo/insensitivefolder/__init__.py	2006-02-25 20:35:38 UTC (rev 65475)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/demo/insensitivefolder/__init__.py	2006-02-25 20:49:32 UTC (rev 65476)
@@ -17,21 +17,22 @@
 """
 __docformat__ = 'restructuredtext'
 
+from zope.component import adapts
+from zope.component.interfaces import IFactory
+from zope.interface import implements, implementedBy
+from zope.interface import directlyProvides, directlyProvidedBy 
+from zope.publisher.interfaces import NotFound
+
 from zope.app import zapi
 from zope.app.folder import Folder
 from zope.app.folder.interfaces import IFolder
 from zope.app.container.traversal import ContainerTraverser
 from zope.app.container.interfaces import IReadContainer
-from zope.component.interfaces import IFactory
-from zope.interface import \
-     implements, implementedBy, directlyProvides, directlyProvidedBy 
-from zope.publisher.interfaces import NotFound
+from zope.app.i18n import ZopeMessageFactory as _
 
-
 class CaseInsensitiveContainerTraverser(ContainerTraverser):
+    adapts(IReadContainer)
 
-    __used_for__ = IReadContainer
-
     def publishTraverse(self, request, name):
         """See zope.publisher.interfaces.browser.IBrowserPublisher"""
         subob = self._guessTraverse(name) 
@@ -63,8 +64,8 @@
     """A Factory that creates case-insensitive Folders."""
     implements(IFactory)
 
-    title = "Case-Insensitive Folder Factory"
-    description = "A Factory that creates case-insensitive Folders."
+    title = _("Case insensitive Folder")
+    description = _("A simple case insensitive Folder.")
 
     def __call__(self):
         """See zope.component.interfaces.IFactory

Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/demo/insensitivefolder/configure.zcml
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/demo/insensitivefolder/configure.zcml	2006-02-25 20:35:38 UTC (rev 65475)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/demo/insensitivefolder/configure.zcml	2006-02-25 20:49:32 UTC (rev 65476)
@@ -22,9 +22,9 @@
       />
 
 <!-- Case-insensitive Folder Registration -->
-<factory
-    id="zope.CaseInsensitiveFolder"
+<utility
     component=".caseInsensitiveFolderFactory"
+    name="zope.CaseInsensitiveFolder"
     />
 
 <browser:addMenuItem

Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/configure.zcml
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/configure.zcml	2006-02-25 20:35:38 UTC (rev 65475)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/configure.zcml	2006-02-25 20:49:32 UTC (rev 65476)
@@ -11,11 +11,10 @@
 
   <!-- Plain Text Support -->
 
-  <factory
+  <utility
       component=".plaintext.PlainTextSourceFactory"
-      id="zope.source.plaintext"
-      title="Plain Text" 
-      description="Plain Text Source" />
+      name="zope.source.plaintext"
+      />
 
   <browser:view
       name=""
@@ -25,11 +24,10 @@
 
   <!-- STX support -->
 
-  <factory
+  <utility
       component=".stx.StructuredTextSourceFactory"
-      id="zope.source.stx"
-      title="Structured Text (STX)"
-      description="Structured Text (STX) Source" />
+      name="zope.source.stx"
+      />
 
   <browser:view
       name=""
@@ -39,11 +37,10 @@
 
   <!-- ReST support -->
 
-  <factory
+  <utility
       component=".rest.ReStructuredTextSourceFactory"
-      id="zope.source.rest"
-      title="ReStructured Text (ReST)"
-      description="ReStructured Text (ReST) Source" />
+      name="zope.source.rest"
+      />
 
   <browser:view
       name=""

Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/plaintext.py
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/plaintext.py	2006-02-25 20:35:38 UTC (rev 65475)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/plaintext.py	2006-02-25 20:49:32 UTC (rev 65476)
@@ -16,18 +16,19 @@
 $Id$
 """
 from zope.interface import implements
+
 from zope.app.publisher.browser import BrowserView
-
+from zope.app.i18n import ZopeMessageFactory as _
 from zope.app.renderer.interfaces import ISource, IHTMLRenderer
 from zope.app.renderer import SourceFactory
 
-
 class IPlainTextSource(ISource):
     """Marker interface for a plain text source. Note that an implementation
     of this interface should always derive from unicode or behave like a
     unicode class."""
 
-PlainTextSourceFactory = SourceFactory(IPlainTextSource)
+PlainTextSourceFactory = SourceFactory(
+    IPlainTextSource, _("Plain Text"), _("Plain Text Source"))
 
 
 class PlainTextToHTMLRenderer(BrowserView):

Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/rest.py
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/rest.py	2006-02-25 20:35:38 UTC (rev 65475)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/rest.py	2006-02-25 20:49:32 UTC (rev 65476)
@@ -22,6 +22,7 @@
 
 from zope.interface import implements
 from zope.app.publisher.browser import BrowserView
+from zope.app.i18n import MessageFactory as _
 from zope.app.renderer.interfaces import ISource, IHTMLRenderer
 from zope.app.renderer import SourceFactory
 
@@ -32,7 +33,9 @@
     behave like a unicode class."""
 
 
-ReStructuredTextSourceFactory = SourceFactory(IReStructuredTextSource)
+ReStructuredTextSourceFactory = SourceFactory(
+    IReStructuredTextSource, _("ReStructured Text (ReST)"),
+    _("ReStructured Text (ReST) Source"))
 
 
 class ZopeTranslator(HTMLTranslator):

Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/stx.py
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/stx.py	2006-02-25 20:35:38 UTC (rev 65475)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/stx.py	2006-02-25 20:49:32 UTC (rev 65476)
@@ -18,10 +18,11 @@
 import re
 
 from zope.interface import implements
-from zope.app.publisher.browser import BrowserView
 from zope.structuredtext.document import Document
 from zope.structuredtext.html import HTML
 
+from zope.app.publisher.browser import BrowserView
+from zope.app.i18n import ZopeMessageFactory as _
 from zope.app.renderer.interfaces import ISource, IHTMLRenderer
 from zope.app.renderer import SourceFactory
 
@@ -31,7 +32,9 @@
     implementation of this interface should always derive from unicode or
     behave like a unicode class."""
 
-StructuredTextSourceFactory = SourceFactory(IStructuredTextSource)
+StructuredTextSourceFactory = SourceFactory(
+    IStructuredTextSource, _("Structured Text (STX)"),
+    _("Structured Text (STX) Source"))
 
 
 class StructuredTextToHTMLRenderer(BrowserView):



More information about the Zope3-Checkins mailing list