Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
973e53c9
Commit
973e53c9
authored
Dec 17, 2006
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed 'strict' mode (now using unicode as internal representation) *always*
parent
985698b2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
13 deletions
+3
-13
lib/python/Products/PageTemplates/ZopePageTemplate.py
lib/python/Products/PageTemplates/ZopePageTemplate.py
+3
-6
lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
...thon/Products/PageTemplates/tests/testZopePageTemplate.py
+0
-7
No files found.
lib/python/Products/PageTemplates/ZopePageTemplate.py
View file @
973e53c9
...
...
@@ -90,7 +90,6 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
func_defaults = None
func_code = FuncCode((), 0)
strict = True
_default_bindings = {'
name_subpath
': '
traverse_subpath
'}
_default_content_fn = os.path.join(package_home(globals()),
...
...
@@ -119,11 +118,9 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
security.declareProtected(view_management_screens,
'
read
', '
ZScriptHTML_tryForm
')
def __init__(self, id, text=None, content_type=None, encoding='
utf
-
8
',
strict=True):
def __init__(self, id, text=None, content_type=None, encoding='
utf
-
8
', strict=True):
self.id = id
self.expand = 0
self.strict = strict
self.ZBindings_edit(self._default_bindings)
self.output_encoding = encoding
if not text:
...
...
@@ -135,7 +132,7 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
security.declareProtected(change_page_templates, '
pt_edit
')
def pt_edit(self, text, content_type, encoding='
utf
-
8
'):
text = text.strip()
if
self.strict and
not isinstance(text, unicode):
if not isinstance(text, unicode):
text = unicode(text, encoding)
self.ZCacheable_invalidate()
...
...
@@ -169,7 +166,7 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
security.declareProtected(change_page_templates, '
pt_setTitle
')
def pt_setTitle(self, title, encoding='
utf
-
8
'):
if
self.strict and
not isinstance(title, unicode):
if not isinstance(title, unicode):
title = unicode(title, encoding)
self._setPropValue('
title
', title)
...
...
lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
View file @
973e53c9
...
...
@@ -174,13 +174,6 @@ class ZPTRegressions(unittest.TestCase):
pt
=
self
.
app
.
pt1
self
.
assertEqual
(
pt
.
document_src
(),
self
.
text
)
def
test_BBB_for_strict_attribute
(
self
):
# Collector 2213: old templates don't have 'strict' attribute.
from
Products.PageTemplates.ZopePageTemplate
import
ZopePageTemplate
zpt
=
ZopePageTemplate
(
'issue_2213'
)
del
zpt
.
strict
# simulate old templates
self
.
assertEqual
(
zpt
.
strict
,
True
)
class
ZPTMacros
(
zope
.
component
.
testing
.
PlacelessSetup
,
unittest
.
TestCase
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment