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
7cdaddf3
Commit
7cdaddf3
authored
Apr 22, 2003
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- clean up some filename manipulation to avoid duplicate work and make
it more readable - remove unused instance variable
parent
5cc7ab63
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
lib/python/Products/PageTemplates/PageTemplateFile.py
lib/python/Products/PageTemplates/PageTemplateFile.py
+6
-5
No files found.
lib/python/Products/PageTemplates/PageTemplateFile.py
View file @
7cdaddf3
...
...
@@ -15,7 +15,7 @@
Zope object encapsulating a Page Template from the filesystem.
"""
__version__
=
'$Revision: 1.2
6
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.2
7
$'
[
11
:
-
2
]
import
os
,
AccessControl
from
Globals
import
package_home
,
DevelopmentMode
...
...
@@ -37,7 +37,6 @@ class PageTemplateFile(Script, PageTemplate, Traversable):
func_defaults
=
None
func_code
=
FuncCode
((),
0
)
_need__name__
=
1
_v_last_read
=
0
_default_bindings
=
{
'name_subpath'
:
'traverse_subpath'
}
...
...
@@ -53,12 +52,14 @@ class PageTemplateFile(Script, PageTemplate, Traversable):
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
.
splitext
(
os
.
path
.
split
(
filename
)[
-
1
])[
0
]
if
not
os
.
path
.
splitext
(
filename
)[
1
]:
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
)
...
...
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