[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/services - connection.py:1.11 registration.py:1.7 utility.py:1.9

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu Aug 7 21:15:17 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/interfaces/services
In directory cvs.zope.org:/tmp/cvs-serv25289/interfaces/services

Modified Files:
	connection.py registration.py utility.py 
Log Message:
I18ned some more. Wow, the RegistrationWidget was tricky, but I fixed it.
I made the RegistrationWidget inherit from RadioWidget, which should have
been done this way in the first place.

I also noticed that there are still occurences where the interface field
attributes are not message-id'ed.


=== Zope3/src/zope/app/interfaces/services/connection.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/interfaces/services/connection.py:1.10	Mon Jul  7 13:14:53 2003
+++ Zope3/src/zope/app/interfaces/services/connection.py	Thu Aug  7 20:14:41 2003
@@ -15,13 +15,13 @@
 
 $Id$
 """
-
-from zope.schema import TextLine
+from zope.app.i18n import ZopeMessageIDFactory as _
 from zope.app.interfaces.services.registration import IComponentRegistration
 from zope.app.interfaces.services.registration import ComponentPath
 from zope.app.interfaces.rdb import IConnectionService
 from zope.app.interfaces.services.registration \
      import INameComponentRegistry
+from zope.schema import TextLine
 
 class IConnectionRegistration(IComponentRegistration):
     """Database Connection Registration
@@ -30,16 +30,17 @@
     configure. They register themselves as component dependents.
     """
 
-    name = TextLine(title=u"Name",
-                    description=u"The name that is registered",
-                    readonly=True,
-                    required=True,
-                    min_length=1,
-                    )
+    name = TextLine(
+        title=_("Name"),
+        description=_("The name that is registered"),
+        readonly=True,
+        required=True,
+        min_length=1,
+        )
 
     componentPath = ComponentPath(
-        title=u"Component path",
-        description=u"The physical path to the component",
+        title=_("Component path"),
+        description=_("The physical path to the component"),
         readonly=True,
         required=True)
 


=== Zope3/src/zope/app/interfaces/services/registration.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/interfaces/services/registration.py:1.6	Thu Aug  7 16:27:36 2003
+++ Zope3/src/zope/app/interfaces/services/registration.py	Thu Aug  7 20:14:41 2003
@@ -34,7 +34,12 @@
 
 class RegistrationStatus(TextLine):
     implements(IRegistrationStatus)
-    allowed_values = UnregisteredStatus, RegisteredStatus, ActiveStatus
+
+    def __init__(self, *args, **kw):
+        super(RegistrationStatus, self).__init__(*args, **kw)
+        self.allowed_values = (UnregisteredStatus,
+                               RegisteredStatus,
+                               ActiveStatus)
 
 class INoLocalServiceError(Interface):
     """No local service to register with.
@@ -67,7 +72,9 @@
                             "this registration type")
     # A string; typically a class attribute
 
-    status = RegistrationStatus(title = u"Registration status")
+    status = RegistrationStatus(
+        title=_("Registration status")
+        )
 
     def activated():
         """Method called when a registration is made active
@@ -101,13 +108,14 @@
     """Registration object that is registered only by name.
     """
 
-    name = TextLine(title=u"Name",
-                    description=u"The name that is registered",
-                    readonly=True,
-                    # Don't allow empty or missing name:
-                    required=True,
-                    min_length=1,
-                    )
+    name = TextLine(
+        title=_("Name"),
+        description=_("The name that is registered"),
+        readonly=True,
+        # Don't allow empty or missing name:
+        required=True,
+        min_length=1,
+        )
 
     # The label is generally set as a class attribute on the
     # registration class.
@@ -134,13 +142,13 @@
     """Registration object that uses a component path and a permission."""
 
     componentPath = ComponentPath(
-        title=u"Component path",
-        description=u"The path to the component; this may be absolute, "
-                    u"or relative to the nearest site management folder",
+        title=_("Component path"),
+        description=_("The path to the component; this may be absolute, "
+                      "or relative to the nearest site management folder"),
         required=True)
 
     permission = PermissionField(
-        title=u"The permission needed to use the component",
+        title=_("The permission needed to use the component"),
         required=False,
         )
 


=== Zope3/src/zope/app/interfaces/services/utility.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/interfaces/services/utility.py:1.8	Wed Aug  6 17:16:38 2003
+++ Zope3/src/zope/app/interfaces/services/utility.py	Thu Aug  7 20:14:41 2003
@@ -15,13 +15,13 @@
 
 $Id$
 """
-
-from zope.app.interfaces.services.registration import IComponentRegistration
 from zope.app.component.interfacefield import InterfaceField
-from zope.schema import TextLine
+from zope.app.i18n import ZopeMessageIDFactory as _
+from zope.app.interfaces.services.registration import IComponentRegistration
 from zope.app.interfaces.services.registration import IRegisterable
 from zope.app.interfaces.services.registration import ComponentPath
 from zope.component.interfaces import IUtilityService
+from zope.schema import TextLine
 
 class IUtilityRegistration(IComponentRegistration):
     """Utility registration object.
@@ -31,22 +31,23 @@
     getComponent() method.
     """
 
-    name = TextLine(title=u"Name",
-                    description=u"The name that is registered",
-                    readonly=True,
-                    required=True,
-                    )
+    name = TextLine(
+        title=_("Name"),
+        description=_("The name that is registered"),
+        readonly=True,
+        required=True,
+        )
 
     interface = InterfaceField(
-        title = u"Provided interface",
-        description = u"The interface provided by the adapter",
+        title = _("Provided interface"),
+        description = _("The interface provided by the adapter"),
         readonly = True,
         required = True,
         )
 
     componentPath = ComponentPath(
-        title=u"Component path",
-        description=u"The physical path to the component",
+        title=_("Component path"),
+        description=_("The physical path to the component"),
         required=True,
         readonly=True,
         )
@@ -64,7 +65,6 @@
     IRegistered can be used; otherwise, they must provide
     another way to be adaptable to IRegistered.
     """
-
 
 
 class ILocalUtilityService(IUtilityService):




More information about the Zope3-Checkins mailing list