[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/utility/browser/ - add missing import (for I18N)

Fred L. Drake, Jr. fdrake at gmail.com
Tue Sep 14 17:22:35 EDT 2004


Log message for revision 27531:
  - add missing import (for I18N)
  - fix message generation for deleted registrations
  


Changed:
  U   Zope3/trunk/src/zope/app/utility/browser/__init__.py
  U   Zope3/trunk/src/zope/app/utility/browser/ftests.py
  A   Zope3/trunk/src/zope/app/utility/browser/utilities.txt


-=-
Modified: Zope3/trunk/src/zope/app/utility/browser/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/utility/browser/__init__.py	2004-09-14 21:07:44 UTC (rev 27530)
+++ Zope3/trunk/src/zope/app/utility/browser/__init__.py	2004-09-14 21:22:34 UTC (rev 27531)
@@ -24,7 +24,9 @@
 from zope.security.proxy import removeSecurityProxy
 from zope.app.introspector import interfaceToName
 
+from zope.app.i18n import ZopeMessageIDFactory as _
 
+
 class AddRegistration(AddComponentRegistration):
     """View for adding a utility registration.
 
@@ -127,9 +129,7 @@
             for info in registry.info():
                 conf = info['registration']
                 obj = conf.getComponent()
-                if first:
-                    done.append(conf.usageSummary())
-                    first = False
+                done.append(conf.usageSummary())
                 path = zapi.getPath(obj)
                 services[path] = obj
                 conf.status = UnregisteredStatus
@@ -144,7 +144,7 @@
             del parent[name]
             
         s = _("Deleted: ${utility_names}")
-        s.mapping = {'utility_names': ", ".join(todo)}
+        s.mapping = {'utility_names': ", ".join(done)}
         return s
 
     def getConfigs(self):

Modified: Zope3/trunk/src/zope/app/utility/browser/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/utility/browser/ftests.py	2004-09-14 21:07:44 UTC (rev 27530)
+++ Zope3/trunk/src/zope/app/utility/browser/ftests.py	2004-09-14 21:22:34 UTC (rev 27531)
@@ -49,7 +49,9 @@
 
 
 def test_suite():
-    return unittest.makeSuite(UtilityViewTestCase)
+    suite = unittest.makeSuite(UtilityViewTestCase)
+    suite.addTest(functional.FunctionalDocFileSuite("utilities.txt"))
+    return suite
 
 if __name__ == "__main__":
     unittest.main(defaultTest="test_suite")

Added: Zope3/trunk/src/zope/app/utility/browser/utilities.txt
===================================================================
--- Zope3/trunk/src/zope/app/utility/browser/utilities.txt	2004-09-14 21:07:44 UTC (rev 27530)
+++ Zope3/trunk/src/zope/app/utility/browser/utilities.txt	2004-09-14 21:22:34 UTC (rev 27531)
@@ -0,0 +1,44 @@
+Managing Utility Registrations
+------------------------------
+
+The user interface for utility registration management allows us to
+deactive a registration by selecting the adjacent checkbox and
+clicking "Deactivate"::
+
+  >>> print http(r"""
+  ... POST /++etc++site/default/Utilities/utilities.html HTTP/1.1
+  ... Authorization: Basic bWdyOm1ncnB3
+  ... Content-Length: 85
+  ... Content-Type: application/x-www-form-urlencoded
+  ... 
+  ... selected%3Alist=%3Azope.app.session.interfaces.IClientIdManager&Deactivate=Deactivate""") \
+  ... #doctest: +NORMALIZE_WHITESPACE
+  HTTP/1.1 200 Ok
+  Content-Length: ...
+  Content-Type: text/html...
+  ...
+  <div class="message">
+  Deactivated: IClientIdManager, implemented by CookieClientIdManager
+  'CookieClientIdManager'
+  ...
+
+Once we've deactivated a utility registration, we can remove it by
+again checking the checkbox next to it in the list and clicking
+"Delete"::
+
+  >>> print http(r"""
+  ... POST /++etc++site/default/Utilities/utilities.html HTTP/1.1
+  ... Authorization: Basic bWdyOm1ncnB3
+  ... Content-Length: 77
+  ... Content-Type: application/x-www-form-urlencoded
+  ... 
+  ... selected%3Alist=%3Azope.app.session.interfaces.IClientIdManager&Delete=Delete""") \
+  ... #doctest: +NORMALIZE_WHITESPACE
+  HTTP/1.1 200 Ok
+  Content-Length: ...
+  Content-Type: text/html...
+  ...
+  <div class="message">
+  Deleted: IClientIdManager, implemented by CookieClientIdManager
+  'CookieClientIdManager'
+  ...


Property changes on: Zope3/trunk/src/zope/app/utility/browser/utilities.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native



More information about the Zope3-Checkins mailing list