[Zope3-checkins] SVN: Zope3/branches/srichter-blow-services/src/zope/ Starting to remove deprecation warnings caused by the changes in

Stephan Richter srichter at cosmos.phy.tufts.edu
Fri Dec 17 17:06:30 EST 2004


Log message for revision 28646:
  Starting to remove deprecation warnings caused by the changes in 
  zope.component.
  
  

Changed:
  U   Zope3/branches/srichter-blow-services/src/zope/i18n/tests/test_itranslationdomain.py
  U   Zope3/branches/srichter-blow-services/src/zope/i18n/tests/test_translationdomain.py
  U   Zope3/branches/srichter-blow-services/src/zope/server/http/tests/test_publisherserver.py

-=-
Modified: Zope3/branches/srichter-blow-services/src/zope/i18n/tests/test_itranslationdomain.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/i18n/tests/test_itranslationdomain.py	2004-12-17 22:04:25 UTC (rev 28645)
+++ Zope3/branches/srichter-blow-services/src/zope/i18n/tests/test_itranslationdomain.py	2004-12-17 22:06:30 UTC (rev 28646)
@@ -19,8 +19,7 @@
 from zope.interface.verify import verifyObject
 from zope.interface import implements
 
-from zope.component import getService
-from zope.component.servicenames import Utilities
+import zope.component as capi
 from zope.component.tests.placelesssetup import PlacelessSetup
 
 from zope.i18n.negotiator import negotiator
@@ -48,8 +47,7 @@
         self._domain = self._getTranslationDomain()
 
         # Setup the negotiator utility
-        utilities = getService(Utilities)
-        utilities.provideUtility(INegotiator, negotiator)        
+        capi.provideUtility(negotiator, INegotiator)        
 
     def testInterface(self):
         verifyObject(ITranslationDomain, self._domain)

Modified: Zope3/branches/srichter-blow-services/src/zope/i18n/tests/test_translationdomain.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/i18n/tests/test_translationdomain.py	2004-12-17 22:04:25 UTC (rev 28645)
+++ Zope3/branches/srichter-blow-services/src/zope/i18n/tests/test_translationdomain.py	2004-12-17 22:06:30 UTC (rev 28646)
@@ -22,8 +22,7 @@
      TestITranslationDomain, Environment
 from zope.i18n import MessageIDFactory
 from zope.i18n.interfaces import ITranslationDomain
-from zope.component.servicenames import Utilities
-from zope.component import getGlobalServices
+import zope.component as capi
 
 def testdir():
     from zope.i18n import tests
@@ -103,8 +102,7 @@
                                            os.path.join(path, 'en-default.mo'))
         domain.addCatalog(en_catalog)
 
-        s = getGlobalServices().getService(Utilities)
-        s.provideUtility(ITranslationDomain, domain, 'other')
+        capi.provideUtility(domain, ITranslationDomain, 'other')
 
         factory = MessageIDFactory('other')
         msgid = factory(u'short_greeting', 'default')

Modified: Zope3/branches/srichter-blow-services/src/zope/server/http/tests/test_publisherserver.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/server/http/tests/test_publisherserver.py	2004-12-17 22:04:25 UTC (rev 28645)
+++ Zope3/branches/srichter-blow-services/src/zope/server/http/tests/test_publisherserver.py	2004-12-17 22:06:30 UTC (rev 28646)
@@ -20,8 +20,8 @@
 from zope.server.taskthreads import ThreadedTaskDispatcher
 from zope.server.http.publisherhttpserver import PublisherHTTPServer
 
-from zope.component.tests.placelesssetup import PlacelessSetup
-import zope.component
+from zope.component.testing import PlacelessSetup
+import zope.component as capi
 
 from zope.i18n.interfaces import IUserPreferredCharsets
 
@@ -90,8 +90,8 @@
 
     def setUp(self):
         super(Tests, self).setUp()
-        as = zope.component.getService('Adapters')
-        as.register([IHTTPRequest], IUserPreferredCharsets, '', HTTPCharsets)
+        capi.provideAdapter(HTTPCharsets,
+                            [IHTTPRequest], IUserPreferredCharsets, '')
         obj = tested_object()
         obj.folder = tested_object()
         obj.folder.item = tested_object()



More information about the Zope3-Checkins mailing list