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
f2ef0f2f
Commit
f2ef0f2f
authored
Jan 08, 2006
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes
parent
6c6bcc50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
lib/python/Products/PageTemplates/ZopePageTemplate.py
lib/python/Products/PageTemplates/ZopePageTemplate.py
+6
-11
No files found.
lib/python/Products/PageTemplates/ZopePageTemplate.py
View file @
f2ef0f2f
...
...
@@ -37,7 +37,8 @@ from PageTemplate import PageTemplate
from
Expressions
import
SecureModuleImporter
from
PageTemplateFile
import
PageTemplateFile
SUPPORTS_WEBDAV_LOCKS
=
1
from
webdav.Lockable
import
ResourceLockedError
from
webdav.WriteLockInterface
import
WriteLockInterface
class
Src
(
Acquisition
.
Explicit
):
" "
...
...
@@ -58,8 +59,7 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
Traversable
,
PropertyManager
):
"Zope wrapper for Page Template using TAL, TALES, and METAL"
if
SUPPORTS_WEBDAV_LOCKS
:
__implements__
=
(
WriteLockInterface
,)
__implements__
=
(
WriteLockInterface
,)
meta_type
=
'Page Template'
...
...
@@ -120,7 +120,7 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
'pt_upload'
,
'pt_changePrefs'
)
def
pt_editAction
(
self
,
REQUEST
,
title
,
text
,
content_type
,
expand
):
"""Change the title and document."""
if
SUPPORTS_WEBDAV_LOCKS
and
self
.
wl_isLocked
():
if
self
.
wl_isLocked
():
raise
ResourceLockedError
,
"File is locked via WebDAV"
self
.
expand
=
expand
self
.
pt_setTitle
(
title
)
...
...
@@ -147,7 +147,7 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
def
pt_upload
(
self
,
REQUEST
,
file
=
''
,
charset
=
None
):
"""Replace the document with the text in file."""
if
SUPPORTS_WEBDAV_LOCKS
and
self
.
wl_isLocked
():
if
self
.
wl_isLocked
():
raise
ResourceLockedError
,
"File is locked via WebDAV"
if
type
(
file
)
is
not
StringType
:
...
...
@@ -261,8 +261,7 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
def
PUT
(
self
,
REQUEST
,
RESPONSE
):
""" Handle HTTP PUT requests """
self
.
dav__init
(
REQUEST
,
RESPONSE
)
if
SUPPORTS_WEBDAV_LOCKS
:
self
.
dav__simpleifhandler
(
REQUEST
,
RESPONSE
,
refresh
=
1
)
self
.
dav__simpleifhandler
(
REQUEST
,
RESPONSE
,
refresh
=
1
)
self
.
write
(
REQUEST
.
get
(
'BODY'
,
''
))
RESPONSE
.
setStatus
(
204
)
return
RESPONSE
...
...
@@ -316,10 +315,6 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
# acquisition context, so we don't know where it is. :-(
return
None
if
not
SUPPORTS_WEBDAV_LOCKS
:
def
wl_isLocked
(
self
):
return
0
setattr
(
ZopePageTemplate
,
'source.xml'
,
ZopePageTemplate
.
source_dot_xml
)
setattr
(
ZopePageTemplate
,
'source.html'
,
ZopePageTemplate
.
source_dot_xml
)
...
...
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