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
2f3bb364
Commit
2f3bb364
authored
Mar 02, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug that caused direct file upluad to fail in the constructor.
parent
94e555c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
lib/python/OFS/DTMLMethod.py
lib/python/OFS/DTMLMethod.py
+5
-2
No files found.
lib/python/OFS/DTMLMethod.py
View file @
2f3bb364
...
...
@@ -102,7 +102,7 @@
##############################################################################
"""DTML Method objects."""
__version__
=
'$Revision: 1.
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
5
$'
[
11
:
-
2
]
from
Globals
import
HTML
,
HTMLFile
,
MessageDialog
from
string
import
join
,
split
,
strip
,
rfind
,
atoi
,
lower
...
...
@@ -252,6 +252,7 @@ class DTMLMethod(cDocument, HTML, Explicit, RoleManager, Item_w__name__):
return
self
.
_er
(
data
,
title
,
SUBMIT
,
dtpref_cols
,
dtpref_rows
,
REQUEST
)
self
.
title
=
title
if
type
(
data
)
is
not
type
(
''
):
data
=
data
.
read
()
self
.
munge
(
data
)
if
REQUEST
:
return
MessageDialog
(
title
=
'Success!'
,
...
...
@@ -261,7 +262,8 @@ class DTMLMethod(cDocument, HTML, Explicit, RoleManager, Item_w__name__):
def
manage_upload
(
self
,
file
=
''
,
REQUEST
=
None
):
"""Replace the contents of the document with the text in file."""
self
.
_validateProxy
(
REQUEST
)
self
.
munge
(
file
.
read
())
if
type
(
file
)
is
not
type
(
''
):
file
=
file
.
read
()
self
.
munge
(
file
)
if
REQUEST
:
return
MessageDialog
(
title
=
'Success!'
,
message
=
'Your changes have been saved'
,
...
...
@@ -370,6 +372,7 @@ def add(self, id, title='', file='', REQUEST=None, submit=None):
"""Add a DTML Method object with the contents of file. If
'
file
' is empty, default document text is used.
"""
if type(file) is not type(''): file=file.read()
if not file: file=default_dm_html
ob=DTMLMethod(file, __name__=id)
ob.title=title
...
...
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