Commit 7dd7aa5c authored by Andreas Jung's avatar Andreas Jung

- Collector #1124: The ZReST product now uses the same reST encoding

       parameters from zope.conf as the low-level reStructuredText
       implementation.
parent 4ebfa7fc
......@@ -109,6 +109,10 @@ Zope Changes
Bugs fixed
- Collector #1124: The ZReST product now uses the same reST encoding
parameters from zope.conf as the low-level reStructuredText
implementation.
- Collector #1259: removed the "uninstall" target from the Makefile
since the uninstall routine could also remove non-Zope files. Because
this was to dangerous it has been removed completely.
......
......@@ -18,9 +18,15 @@ from Persistence import Persistent
from AccessControl import ClassSecurityInfo
from AccessControl import ModuleSecurityInfo
from DateTime.DateTime import DateTime
from App.config import getConfiguration
import sys
modulesecurity = ModuleSecurityInfo()
default_enc = sys.getdefaultencoding()
default_output_encoding = getConfiguration().rest_output_encoding or default_enc
default_input_encoding = getConfiguration().rest_input_encoding or default_enc
modulesecurity.declareProtected('View management screens',
'manage_addZReSTForm')
manage_addZReSTForm = DTMLFile('dtml/manage_addZReSTForm', globals())
......@@ -47,22 +53,23 @@ class ZReST(Item, PropertyManager, Historical, Implicit, Persistent):
meta_type = 'ReStructuredText Document'
security = ClassSecurityInfo()
def __init__(self, id):
def __init__(self, id,output_encoding=default_output_encoding,
input_encoding=default_input_encoding):
self.id = id
self.title = id
self.stylesheet = 'default.css'
self.report_level = '2'
self.source = self.formatted = ''
self.input_encoding = 'iso-8859-15'
self.output_encoding = 'iso-8859-15'
self.input_encoding = input_encoding
self.output_encoding = output_encoding
# define the properties that define this object
_properties = (
{'id':'stylesheet', 'type': 'string', 'mode': 'w',
'default': 'default.css'},
{'id':'report_level', 'type': 'string', 'mode': 'w', 'default': '2'},
{'id':'input_encoding', 'type': 'string', 'mode': 'w', 'default': 'iso-8859-15'},
{'id':'output_encoding', 'type': 'string', 'mode': 'w', 'default': 'iso-8859-15'},
{'id':'input_encoding', 'type': 'string', 'mode': 'w', 'default': default_input_encoding},
{'id':'output_encoding', 'type': 'string', 'mode': 'w', 'default': default_output_encoding},
)
property_extensible_schema__ = 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment