Author: reebalazs
Date: Thu Nov 20 11:35:14 2008
New Revision: 60009

Modified:
   kukit/kss.core/trunk/kss/core/pluginregistry/json/utils.py
Log:
Attempt to fix json support (was: 
Module kss.core.pluginregistry.json.utils, line 27, in getJsonAddonFiles
UnboundLocalError: local variable 'jsonrpc' referenced before assignment)

Modified: kukit/kss.core/trunk/kss/core/pluginregistry/json/utils.py
==============================================================================
--- kukit/kss.core/trunk/kss/core/pluginregistry/json/utils.py  (original)
+++ kukit/kss.core/trunk/kss/core/pluginregistry/json/utils.py  Thu Nov 20 
11:35:14 2008
@@ -5,7 +5,6 @@
 import os.path, logging
 import zope.component as capi
 from zope.interface import implements, Interface
-from zope.publisher.browser import TestRequest
 from interfaces import IJSONStreamWriteable
 
 logger = logging.getLogger('kss.core')
@@ -16,19 +15,19 @@
     # Try adding the jsonserver files
     request = getattr(capi.getSiteManager(), 'REQUEST', None)
 
-    try:
-        if request is not None:
+    if request is not None:
+        try:
             # use the files already registered to that concat resource
             jsonrpc = capi.getAdapter(request, Interface, 'jsonrpc.js')
-    except capi.ComponentLookupError:
-        pass    # JSON not present.
-    else:
-        # JSON present.
-        files.extend(jsonrpc.context.context.getPathList())
-        # add the json kukit support file
-        plugins_dir = os.path.split(globals()['__file__'])[0]
-        files.append(os.path.join(plugins_dir, 'browser', 'jsonkukit.js'))
-        logger.info('Lazy plugin construction: Installed support for JSON-RPC 
transport.')
+        except capi.ComponentLookupError:
+            pass    # JSON not present.
+        else:
+            # JSON present.
+            files.extend(jsonrpc.context.context.getPathList())
+            # add the json kukit support file
+            plugins_dir = os.path.split(globals()['__file__'])[0]
+            files.append(os.path.join(plugins_dir, 'browser', 'jsonkukit.js'))
+            logger.info('Lazy plugin construction: Installed support for 
JSON-RPC transport.')
     return files
 
 class JsonCommandView(object):
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to