[z3-checkins] r26445 - in z3/jsonserver/trunk: . tests

jwashin at codespeak.net jwashin at codespeak.net
Thu Apr 27 15:06:51 CEST 2006


Author: jwashin
Date: Thu Apr 27 15:06:47 2006
New Revision: 26445

Modified:
   z3/jsonserver/trunk/jsonrpc.py
   z3/jsonserver/trunk/metaconfigure.py
   z3/jsonserver/trunk/tests/test_directives.py
   z3/jsonserver/trunk/tests/test_httpfactory.py
Log:
update for z3 trunk changes


Modified: z3/jsonserver/trunk/jsonrpc.py
==============================================================================
--- z3/jsonserver/trunk/jsonrpc.py	(original)
+++ z3/jsonserver/trunk/jsonrpc.py	Thu Apr 27 15:06:47 2006
@@ -20,6 +20,7 @@
 #2005-09-08 updated to work with the new IResult idea (wsgi)
 #2005-10-09 unicode handling update
 #2006-03-09 enabled gzip compression for large responses
+#2006-04-27 updated to sync with z3 trunk changes jmw
 
 __docformat__ = 'restructuredtext'
 
@@ -28,7 +29,11 @@
     IJSONRPCRequest, IJSONReader, IJSONWriter
 from zope.interface import implements
 #from zope.publisher.http import IResult
-from zope.app.location.location import Location
+try:
+    from zope.location.location import Location
+except ImportError:
+    #deprecate this for 3.5
+    from zope.app.location.location import Location
 from zope.publisher.http import HTTPRequest, HTTPResponse, \
     getCharsetUsingRequest, DirectResult
 from zope.publisher.browser import BrowserRequest

Modified: z3/jsonserver/trunk/metaconfigure.py
==============================================================================
--- z3/jsonserver/trunk/metaconfigure.py	(original)
+++ z3/jsonserver/trunk/metaconfigure.py	Thu Apr 27 15:06:47 2006
@@ -1,7 +1,7 @@
 ############################################################################
 ##
 #
-# Copyright (c) 2001 - 2005 Zope Corporation and Contributors. 
+# Copyright (c) 2001 - 2005 Zope Corporation and Contributors.
 # All Rights Reserved.
 #
 # This software is subject to the provisions of the Zope Public License,
@@ -17,6 +17,7 @@
 
 like zope.app.publisher.xmlrpc.metaconfigure
 
+Updated 2006-04-27 to sync with zope3 trunk jmw
 updated 2005-12-03 Roger Ineichen
 jwashin 2005-06-06
 """
@@ -26,8 +27,8 @@
 from zope.configuration.exceptions import ConfigurationError
 from interfaces import IJSONRPCRequest
 
-from zope.app.component.interface import provideInterface
-from zope.app.component.metaconfigure import handler
+from zope.component.interface import provideInterface
+from zope.component.zcml import handler
 from jsonrpc import MethodPublisher
 
 def view(_context, for_=None, interface=None, methods=None,
@@ -57,8 +58,7 @@
     # Make sure that the class inherits MethodPublisher, so that the views
     # have a location
     if class_ is None:
-        class_ = MethodPublisher
-        original_class = class_
+        class_ = original_class = MethodPublisher
     else:
         original_class = class_
         class_ = type(class_.__name__, (class_, MethodPublisher), {})
@@ -83,8 +83,8 @@
         _context.action(
             discriminator = ('view', for_, name, IJSONRPCRequest),
             callable = handler,
-            args = ('provideAdapter',
-                    (for_, IJSONRPCRequest), Interface, name, class_,
+            args = ('registerAdapter',
+                    class_, (for_, IJSONRPCRequest), Interface, name,
                     _context.info)
             )
     else:
@@ -101,8 +101,8 @@
             _context.action(
                 discriminator = ('view', for_, name, IJSONRPCRequest),
                 callable = handler,
-                args = ('provideAdapter',
-                        (for_, IJSONRPCRequest), Interface, name, new_class,
+                args = ('registerAdapter',
+                        new_class, (for_, IJSONRPCRequest), Interface, name,
                         _context.info)
                 )
 

Modified: z3/jsonserver/trunk/tests/test_directives.py
==============================================================================
--- z3/jsonserver/trunk/tests/test_directives.py	(original)
+++ z3/jsonserver/trunk/tests/test_directives.py	Thu Apr 27 15:06:47 2006
@@ -1,6 +1,6 @@
 ##############################################################################
 #
-# Copyright (c) 2001 - 2005 Zope Corporation and Contributors. 
+# Copyright (c) 2001 - 2005 Zope Corporation and Contributors.
 # All Rights Reserved.
 #
 # This software is subject to the provisions of the Zope Public License,
@@ -19,11 +19,11 @@
 
 from zope.configuration import xmlconfig
 from zope.configuration.exceptions import ConfigurationError
-from zope.app.component.tests.views import IC, V1
+from zope.app.component.tests.views import IC, V1, Request
 from zope.app.testing.placelesssetup import PlacelessSetup
 from zope.security.proxy import ProxyFactory
 
-from zope.component.tests.request import Request
+#from zope.component.tests.request import Request
 
 from jsonserver.interfaces import IJSONRPCRequest
 

Modified: z3/jsonserver/trunk/tests/test_httpfactory.py
==============================================================================
--- z3/jsonserver/trunk/tests/test_httpfactory.py	(original)
+++ z3/jsonserver/trunk/tests/test_httpfactory.py	Thu Apr 27 15:06:47 2006
@@ -1,6 +1,6 @@
 ##############################################################################
 #
-# Copyright (c) 2003 - 2005 Zope Corporation and Contributors. 
+# Copyright (c) 2003 - 2005 Zope Corporation and Contributors.
 # All Rights Reserved.
 #
 # This software is subject to the provisions of the Zope Public License,
@@ -23,7 +23,7 @@
 from zope.publisher.browser import BrowserRequest
 from zope.publisher.http import HTTPRequest
 from jsonserver.jsonrpc import JSONRPCRequest
-from zope.component.tests.placelesssetup import PlacelessSetup
+from zope.component.testing import PlacelessSetup
 from jsonserver.interfaces import IJSONRPCRequestFactory
 from zope.app.publication.httpfactory import HTTPPublicationRequestFactory
 from zope.app.publication.browser import BrowserPublication


More information about the z3-checkins mailing list