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
8851a0e3
Commit
8851a0e3
authored
Nov 15, 2001
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change macro handling and document_src content-type.
parent
461cec96
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
lib/python/Products/PageTemplates/PageTemplateFile.py
lib/python/Products/PageTemplates/PageTemplateFile.py
+6
-8
No files found.
lib/python/Products/PageTemplates/PageTemplateFile.py
View file @
8851a0e3
...
@@ -87,7 +87,7 @@
...
@@ -87,7 +87,7 @@
Zope object encapsulating a Page Template from the filesystem.
Zope object encapsulating a Page Template from the filesystem.
"""
"""
__version__
=
'$Revision: 1.
6
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
7
$'
[
11
:
-
2
]
import
os
,
AccessControl
,
Acquisition
,
sys
import
os
,
AccessControl
,
Acquisition
,
sys
from
Globals
import
package_home
,
DevelopmentMode
from
Globals
import
package_home
,
DevelopmentMode
...
@@ -102,11 +102,6 @@ from Expressions import SecureModuleImporter
...
@@ -102,11 +102,6 @@ from Expressions import SecureModuleImporter
from
ComputedAttribute
import
ComputedAttribute
from
ComputedAttribute
import
ComputedAttribute
from
ExtensionClass
import
Base
from
ExtensionClass
import
Base
class
MacroCollection
(
Base
):
def
__of__
(
self
,
parent
):
parent
.
_cook_check
()
return
parent
.
_v_macros
class
PageTemplateFile
(
Script
,
PageTemplate
,
Traversable
):
class
PageTemplateFile
(
Script
,
PageTemplate
,
Traversable
):
"Zope wrapper for filesystem Page Template using TAL, TALES, and METAL"
"Zope wrapper for filesystem Page Template using TAL, TALES, and METAL"
...
@@ -116,7 +111,6 @@ class PageTemplateFile(Script, PageTemplate, Traversable):
...
@@ -116,7 +111,6 @@ class PageTemplateFile(Script, PageTemplate, Traversable):
func_code
=
FuncCode
((),
0
)
func_code
=
FuncCode
((),
0
)
_need__name__
=
1
_need__name__
=
1
_v_last_read
=
0
_v_last_read
=
0
macros
=
MacroCollection
()
_default_bindings
=
{
'name_subpath'
:
'traverse_subpath'
}
_default_bindings
=
{
'name_subpath'
:
'traverse_subpath'
}
...
@@ -173,6 +167,10 @@ class PageTemplateFile(Script, PageTemplate, Traversable):
...
@@ -173,6 +167,10 @@ class PageTemplateFile(Script, PageTemplate, Traversable):
finally
:
finally
:
security
.
removeContext
(
self
)
security
.
removeContext
(
self
)
def
pt_macro
(
self
):
self
.
_cook_check
()
return
PageTemplate
.
pt_macro
(
self
)
def
_cook_check
(
self
):
def
_cook_check
(
self
):
if
self
.
_v_last_read
and
not
DevelopmentMode
:
if
self
.
_v_last_read
and
not
DevelopmentMode
:
return
return
...
@@ -193,7 +191,7 @@ class PageTemplateFile(Script, PageTemplate, Traversable):
...
@@ -193,7 +191,7 @@ class PageTemplateFile(Script, PageTemplate, Traversable):
"""Return expanded document source."""
"""Return expanded document source."""
if
RESPONSE
is
not
None
:
if
RESPONSE
is
not
None
:
RESPONSE
.
setHeader
(
'Content-Type'
,
self
.
content_type
)
RESPONSE
.
setHeader
(
'Content-Type'
,
'text/plain'
)
return
self
.
read
()
return
self
.
read
()
def
_get__roles__
(
self
):
def
_get__roles__
(
self
):
...
...
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