[KSS-checkins] r52436 - in kukit: kss.core/branch/kss.core-on-kss.zope/src/kss/core kss.core/branch/kss.core-on-kss.zope/src/kss/core/browser kss.zope/trunk/kss/zope kss.zope/trunk/kss/zope/browser kss.zope/trunk/kss/zope/tests
jvloothuis at codespeak.net
jvloothuis at codespeak.net
Wed Mar 12 23:08:57 CET 2008
Author: jvloothuis
Date: Wed Mar 12 23:08:55 2008
New Revision: 52436
Added:
kukit/kss.zope/trunk/kss/zope/browser/errorresponse.pt
- copied unchanged from r52399, kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/browser/errorresponse.pt
kukit/kss.zope/trunk/kss/zope/browserview.py
- copied unchanged from r52399, kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/browserview.py
kukit/kss.zope/trunk/kss/zope/tests/test_browserview.py
- copied unchanged from r52399, kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/tests/test_browserview.py
Removed:
kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/browser/errorresponse.pt
kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/browserview.py
Modified:
kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/configure.zcml
kukit/kss.zope/trunk/kss/zope/configure.zcml
Log:
Moved the kss error view from kss.core to kss.zope
Deleted: /kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/browser/errorresponse.pt
==============================================================================
--- /kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/browser/errorresponse.pt Wed Mar 12 23:08:55 2008
+++ (empty file)
@@ -1,11 +0,0 @@
-<?xml version="1.0"?>
-<kukit xmlns="http://www.kukit.org/commands/1.0"
- xmlns:tal="http://xml.zope.org/namespaces/tal"
- xmlns:metal="http://xml.zope.org/namespaces/metal">
-<commands>
- <command name="error">
- <param name="type" tal:content="options/type | nothing">system</param>
- <param name="message" tal:content="options/message">Exception: reason</param>
- </command>
-</commands>
-</kukit>
Deleted: /kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/browserview.py
==============================================================================
--- /kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/browserview.py Wed Mar 12 23:08:55 2008
+++ (empty file)
@@ -1,54 +0,0 @@
-# Copyright (c) 2006-2007
-# Authors: KSS Project Contributors (see docs/CREDITS.txt)
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as published
-# by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-#
-
-import cgi, warnings
-
-try:
- from Products.Five import BrowserView
-except ImportError:
- from zope.app.publisher.browser import BrowserView
-from zope.pagetemplate.pagetemplatefile import PageTemplateFile
-
-class KSSBrowserView(BrowserView):
-
- # XML output gets rendered via a page template
- # XXX note: barefoot rendering, use python: only after zope2.9
- render_error = PageTemplateFile('browser/errorresponse.pt')
-
- def attach_error(self, err_type, err_value):
- 'Attach the error payload on the response'
- message = '%s: %s' % (err_type, err_value)
- message = cgi.escape(message)
- payload = self.render_error(type='system', message=message)
- self.attach_payload(payload)
-
- def attach_payload(self, payload, header_name='X-KSSCOMMANDS'):
- 'Attach the commands on the response'
- # get rid of newlines
- payload = payload.replace('\n', ' ')
- self.request.response.setHeader(header_name, payload)
-
-# coherent naming KSS
-# deprecate Kss
-class KssBrowserView(KSSBrowserView):
- def __init__(self, *args, **kw):
- message = "'KssBrowserView' is deprecated," \
- "use 'KSSBrowserView'- KSS uppercase instead."
- warnings.warn(message, DeprecationWarning, 2)
- KSSBrowserView.__init__(self, *args, **kw)
-
Modified: kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/configure.zcml
==============================================================================
--- kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/configure.zcml (original)
+++ kukit/kss.core/branch/kss.core-on-kss.zope/src/kss/core/configure.zcml Wed Mar 12 23:08:55 2008
@@ -37,15 +37,6 @@
<!-- name="base2-dom-fp.js" -->
<!-- /> -->
-
- <!-- (non-kss) browser view -->
- <!-- <browser:page -->
- <!-- for="*" -->
- <!-- name="kss_view" -->
- <!-- permission="zope.Public" -->
- <!-- class=".browserview.KSSBrowserView" -->
- <!-- allowed_attributes="attach_error" -->
- <!-- /> -->
<!-- <browser:page -->
<!-- for="*" -->
Modified: kukit/kss.zope/trunk/kss/zope/configure.zcml
==============================================================================
--- kukit/kss.zope/trunk/kss/zope/configure.zcml (original)
+++ kukit/kss.zope/trunk/kss/zope/configure.zcml Wed Mar 12 23:08:55 2008
@@ -41,6 +41,14 @@
+ <!-- Error page helper view -->
+ <browser:page
+ for="*"
+ name="kss_view"
+ permission="zope.Public"
+ class=".browserview.KSSBrowserView"
+ allowed_attributes="attach_error"
+ />
More information about the Kukit-checkins
mailing list