[z3-checkins] r31277 - z3/jsonserver/branch/merge/z2_compatibility
reebalazs at codespeak.net
reebalazs at codespeak.net
Sun Aug 13 10:13:21 CEST 2006
Author: reebalazs
Date: Sun Aug 13 10:13:19 2006
New Revision: 31277
Modified:
z3/jsonserver/branch/merge/z2_compatibility/browserconfigure.py
z3/jsonserver/branch/merge/z2_compatibility/interfaces.py
z3/jsonserver/branch/merge/z2_compatibility/jsonrpc.py
Log:
z2 compatibility: now use the z3 interface for JSON requests
Modified: z3/jsonserver/branch/merge/z2_compatibility/browserconfigure.py
==============================================================================
--- z3/jsonserver/branch/merge/z2_compatibility/browserconfigure.py (original)
+++ z3/jsonserver/branch/merge/z2_compatibility/browserconfigure.py Sun Aug 13 10:13:19 2006
@@ -55,7 +55,10 @@
from Products.Five.browser.metaconfigure import _handle_for, _handle_menu, ViewMixinForAttributes, \
ViewMixinForTemplates, makeClassForTemplate
-from interfaces import IJsonRequest
+try:
+ from jsonserver.interfaces import IJSONRPCRequest
+except ImportError:
+ from Products.jsonserver.interfaces import IJSONRPCRequest
def page(_context, name, permission, for_,
layer=_layer, template=None, class_=None,
@@ -159,15 +162,15 @@
if _pre_2_9:
_context.action(
- discriminator = ('view', for_, name, IJsonRequest, layer),
+ discriminator = ('view', for_, name, IJSONRPCRequest, layer),
callable = handler,
args = (Presentation, 'provideAdapter',
- IJsonRequest, new_class, name, [for_], Interface, layer,
+ IJSONRPCRequest, new_class, name, [for_], Interface, layer,
_context.info),
)
else:
_context.action(
- discriminator = ('view', for_, name, IJsonRequest, layer),
+ discriminator = ('view', for_, name, IJSONRPCRequest, layer),
callable = handler,
args = ('provideAdapter',
(for_, layer), Interface, name, new_class, _context.info),
Modified: z3/jsonserver/branch/merge/z2_compatibility/interfaces.py
==============================================================================
--- z3/jsonserver/branch/merge/z2_compatibility/interfaces.py (original)
+++ z3/jsonserver/branch/merge/z2_compatibility/interfaces.py Sun Aug 13 10:13:19 2006
@@ -9,7 +9,3 @@
class IFolder(Interface):
'All folderish types we want to bind the resource to'
pass
-
-class IJsonRequest(IBrowserRequest):
- 'Json requests'
- pass
Modified: z3/jsonserver/branch/merge/z2_compatibility/jsonrpc.py
==============================================================================
--- z3/jsonserver/branch/merge/z2_compatibility/jsonrpc.py (original)
+++ z3/jsonserver/branch/merge/z2_compatibility/jsonrpc.py Sun Aug 13 10:13:19 2006
@@ -21,8 +21,11 @@
from cgi import FieldStorage
import ZPublisher.HTTPResponse
from zope.interface import directlyProvides, directlyProvidedBy
-from interfaces import IJsonRequest
from ZPublisher.HTTPRequest import HTTPRequest
+try:
+ from jsonserver.interfaces import IJSONRPCRequest
+except ImportError:
+ from Products.jsonserver.interfaces import IJSONRPCRequest
logger = logging.getLogger('jsonserver')
@@ -284,7 +287,7 @@
setDefaultSkin(self)
#
interfaces = directlyProvidedBy(self)
- interfaces += IJsonRequest
+ interfaces += IJSONRPCRequest
directlyProvides(self, interfaces)
#
response = Response(response, jsonID)
More information about the z3-checkins
mailing list