[Zope3-checkins] SVN: Zope3/branches/ajung-tarek-request-publication-branch/src/zope/app/publication/ renamed getRequestPublication() to just __call__()

Andreas Jung andreas at andreas-jung.com
Fri Oct 7 00:34:10 EDT 2005


Log message for revision 38841:
  renamed getRequestPublication() to just __call__()
  

Changed:
  U   Zope3/branches/ajung-tarek-request-publication-branch/src/zope/app/publication/interfaces.py
  U   Zope3/branches/ajung-tarek-request-publication-branch/src/zope/app/publication/publicationfactories.py
  U   Zope3/branches/ajung-tarek-request-publication-branch/src/zope/app/publication/tests/test_publicationfactories.py

-=-
Modified: Zope3/branches/ajung-tarek-request-publication-branch/src/zope/app/publication/interfaces.py
===================================================================
--- Zope3/branches/ajung-tarek-request-publication-branch/src/zope/app/publication/interfaces.py	2005-10-06 22:50:17 UTC (rev 38840)
+++ Zope3/branches/ajung-tarek-request-publication-branch/src/zope/app/publication/interfaces.py	2005-10-07 04:34:09 UTC (rev 38841)
@@ -115,5 +115,5 @@
             to make a decision based on the HTTP headers.
         """
 
-    def getRequestPublication():
+    def __call__():
         """ returns a tuple (request, publication) """

Modified: Zope3/branches/ajung-tarek-request-publication-branch/src/zope/app/publication/publicationfactories.py
===================================================================
--- Zope3/branches/ajung-tarek-request-publication-branch/src/zope/app/publication/publicationfactories.py	2005-10-06 22:50:17 UTC (rev 38840)
+++ Zope3/branches/ajung-tarek-request-publication-branch/src/zope/app/publication/publicationfactories.py	2005-10-07 04:34:09 UTC (rev 38841)
@@ -40,7 +40,7 @@
         self.soap_req = component.queryUtility(interfaces.ISOAPRequestFactory)
         return bool(environment.get('HTTP_SOAPACTION') and self.soap_req)
 
-    def getRequestPublication(self):
+    def __call__(self):
         return self.soap_req, SOAPPublication
 
 
@@ -51,7 +51,7 @@
     def canHandle(self, environment):
         return True
 
-    def getRequestPublication(self):
+    def __call__(self):
         request_class = component.queryUtility(
             interfaces.IXMLRPCRequestFactory, default=XMLRPCRequest)
         return request_class, XMLRPCPublication
@@ -64,7 +64,7 @@
     def canHandle(self, environment):
         return True
 
-    def getRequestPublication(self):
+    def __call__(self):
         request_class = component.queryUtility(
             interfaces.IHTTPRequestFactory, default=HTTPRequest)
         return request_class, HTTPPublication
@@ -76,7 +76,7 @@
     def canHandle(self, environment):
         return True
 
-    def getRequestPublication(self):
+    def __call__(self):
         request_class = component.queryUtility(
                 interfaces.IBrowserRequestFactory, default=BrowserRequest)
         return request_class, BrowserPublication

Modified: Zope3/branches/ajung-tarek-request-publication-branch/src/zope/app/publication/tests/test_publicationfactories.py
===================================================================
--- Zope3/branches/ajung-tarek-request-publication-branch/src/zope/app/publication/tests/test_publicationfactories.py	2005-10-06 22:50:17 UTC (rev 38840)
+++ Zope3/branches/ajung-tarek-request-publication-branch/src/zope/app/publication/tests/test_publicationfactories.py	2005-10-07 04:34:09 UTC (rev 38841)
@@ -66,7 +66,7 @@
         self.assertEqual(factory.canHandle(env), False)
         env['HTTP_SOAPACTION'] = 'server:foo'
         self.assertEqual(factory.canHandle(env), True)
-        request, publication = factory.getRequestPublication()
+        request, publication = factory()
         self.assertEqual(isinstance(request, DummyRequestFactory), True)
         self.assertEqual(publication, SOAPPublication)
 
@@ -78,7 +78,7 @@
         env = self.__env
         factory = XMLRPCFactory()
         self.assertEqual(factory.canHandle(env), True)
-        request, publication = factory.getRequestPublication()
+        request, publication = factory()
         self.assertEqual(isinstance(request, DummyRequestFactory), True)
         self.assertEqual(publication, XMLRPCPublication)
 
@@ -90,7 +90,7 @@
         env = self.__env
         factory = HTTPFactory()
         self.assertEqual(factory.canHandle(env), True)
-        request, publication = factory.getRequestPublication()
+        request, publication = factory()
         self.assertEqual(isinstance(request, DummyRequestFactory), True)
         self.assertEqual(publication, HTTPPublication)
 
@@ -102,7 +102,7 @@
         env = self.__env
         factory = BrowserFactory()
         self.assertEqual(factory.canHandle(env), True)
-        request, publication = factory.getRequestPublication()
+        request, publication = factory()
         self.assertEqual(isinstance(request, DummyRequestFactory), True)
         self.assertEqual(publication, BrowserPublication)
 



More information about the Zope3-Checkins mailing list