call the python script class PythonScript; try to handle unicode correctly

git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@1870 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2007-08-03 09:54:45 +00:00
parent 0af3bb6512
commit 01935abab7
2 changed files with 7 additions and 7 deletions

View file

@ -11,7 +11,7 @@
# FOR A PARTICULAR PURPOSE. # FOR A PARTICULAR PURPOSE.
# #
############################################################################## ##############################################################################
"""Python Page Browser Views """Python Script Browser Views
$Id$ $Id$
""" """
@ -24,7 +24,7 @@ class PythonScriptEval(object):
"""Evaluate the Python Script.""" """Evaluate the Python Script."""
def index(self, **kw): def index(self, **kw):
"""Call a Python Page""" """Call a Python Script"""
self.request.response.setHeader('content-type', self.request.response.setHeader('content-type',
self.context.contentType) self.context.contentType)
result = self.context(self.request, **kw) result = self.context(self.request, **kw)
@ -34,14 +34,14 @@ class PythonScriptEval(object):
class PythonScriptEditView(EditView): class PythonScriptEditView(EditView):
"""Edit View Class for Python Page.""" """Edit View Class for Python Script."""
syntaxError = None syntaxError = None
def update(self): def update(self):
"""Update the content with the HTML form data.""" """Update the content with the HTML form data."""
try: try:
status = super(PythonPageEditView, self).update() status = super(PythonScriptEditView, self).update()
except SyntaxError, err: except SyntaxError, err:
self.syntaxError = err self.syntaxError = err
status = _('A syntax error occurred.') status = _('A syntax error occurred.')

View file

@ -48,8 +48,8 @@
<browser:addMenuItem <browser:addMenuItem
class=".script.PythonScript" class=".script.PythonScript"
title="Python Page" title="Python Script"
description="An Python Page" description="An Python Script"
permission="zope.ManageContent" permission="zope.ManageContent"
view="AddPythonScript.html" view="AddPythonScript.html"
/> />
@ -58,7 +58,7 @@
for=".interfaces.IPythonScript" for=".interfaces.IPythonScript"
schema=".interfaces.IPythonScript" schema=".interfaces.IPythonScript"
name="edit.html" name="edit.html"
label="Edit Python Page" label="Edit Python Script"
class=".browser.PythonScriptEditView" class=".browser.PythonScriptEditView"
template="edit.pt" template="edit.pt"
permission="zope.ManageContent" permission="zope.ManageContent"