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
d7b65795
Commit
d7b65795
authored
Dec 11, 2005
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added
parent
e5d71456
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
lib/python/Products/PageTemplates/PageTemplateFile.py
lib/python/Products/PageTemplates/PageTemplateFile.py
+31
-0
No files found.
lib/python/Products/PageTemplates/PageTemplateFile.py
0 → 100644
View file @
d7b65795
import
os
from
Globals
import
package_home
,
InitializeClass
from
ZopePageTemplate
import
ZopePageTemplate
class
PageTemplateFile
(
ZopePageTemplate
):
def
__init__
(
self
,
filename
,
_prefix
=
None
,
**
kw
):
self
.
ZBindings_edit
(
self
.
_default_bindings
)
if
_prefix
is
None
:
_prefix
=
getConfiguration
().
softwarehome
elif
not
isinstance
(
_prefix
,
str
):
_prefix
=
package_home
(
_prefix
)
name
=
kw
.
get
(
'__name__'
)
basepath
,
ext
=
os
.
path
.
splitext
(
filename
)
if
name
:
self
.
_need__name__
=
0
self
.
__name__
=
name
else
:
self
.
__name__
=
os
.
path
.
basename
(
basepath
)
if
not
ext
:
# XXX This is pretty bogus, but can't be removed since
# it's been released this way.
filename
=
filename
+
'.zpt'
self
.
filename
=
os
.
path
.
join
(
_prefix
,
filename
)
ZopePageTemplate
.
__init__
(
self
,
os
.
path
.
basename
(
self
.
filename
),
open
(
self
.
filename
).
read
(),
'text/html'
)
InitializeClass
(
PageTemplateFile
)
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