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
cc3ec6f5
Commit
cc3ec6f5
authored
Jan 28, 1999
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added last_modified, size
parent
32f0a33d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
6 deletions
+22
-6
lib/python/OFS/Image.py
lib/python/OFS/Image.py
+6
-6
lib/python/OFS/documentEdit.dtml
lib/python/OFS/documentEdit.dtml
+16
-0
No files found.
lib/python/OFS/Image.py
View file @
cc3ec6f5
...
...
@@ -102,7 +102,7 @@
##############################################################################
"""Image object"""
__version__
=
'$Revision: 1.5
0
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.5
1
$'
[
11
:
-
2
]
import
Globals
from
Globals
import
HTMLFile
,
MessageDialog
...
...
@@ -174,7 +174,7 @@ class File(Persistent,Implicit,PropertyManager,
if
not
content_type
:
raise
'BadValue'
,
'No content type specified.'
data
=
(
headers
is
None
)
and
file
or
file
.
read
()
self
.
_update_data
(
data
,
content_type
)
self
.
post_process
(
data
,
content_type
)
def
id
(
self
):
return
self
.
__name__
...
...
@@ -205,7 +205,7 @@ class File(Persistent,Implicit,PropertyManager,
"""
raise
'Redirect'
,
URL1
def
_update_data
(
self
,
data
,
content_type
=
None
):
def
post_process
(
self
,
data
,
content_type
=
None
):
if
content_type
is
not
None
:
self
.
content_type
=
content_type
self
.
data
=
Pdata
(
data
)
...
...
@@ -233,7 +233,7 @@ class File(Persistent,Implicit,PropertyManager,
if
file
.
headers
.
has_key
(
'content-type'
):
content_type
=
file
.
headers
[
'content-type'
]
else
:
content_type
=
None
self
.
_update_data
(
file
.
read
(),
content_type
)
self
.
post_process
(
file
.
read
(),
content_type
)
if
REQUEST
:
return
MessageDialog
(
title
=
'Success!'
,
message
=
'Your changes have been saved'
,
...
...
@@ -249,7 +249,7 @@ class File(Persistent,Implicit,PropertyManager,
def
PUT
(
self
,
BODY
,
REQUEST
):
"""Handle HTTP PUT requests"""
content_type
=
REQUEST
.
get
(
'CONTENT_TYPE'
,
None
)
self
.
_update_data
(
BODY
,
content_type
)
self
.
post_process
(
BODY
,
content_type
)
def
getSize
(
self
):
"""Get the size of a file or image.
...
...
@@ -309,7 +309,7 @@ class Image(File):
kind
=
'image'
)
manage
=
manage_main
=
manage_editForm
def
_update_data
(
self
,
data
,
content_type
=
None
):
def
post_process
(
self
,
data
,
content_type
=
None
):
if
content_type
is
not
None
:
self
.
content_type
=
content_type
self
.
data
=
Pdata
(
data
)
...
...
lib/python/OFS/documentEdit.dtml
View file @
cc3ec6f5
...
...
@@ -21,6 +21,22 @@
<!--#/if title-->
</TD>
</TR>
<tr>
<th align="left" valign="top">
<em>Size</em>
</th>
<td align="left" valign="top">
<!--#var get_size thousands_commas--> bytes
</td>
</tr>
<tr>
<th align="left" valign="top">
<em>Last modified</em>
</th>
<td align="left" valign="top">
<!--#var bobobase_modification_time-->
</td>
</tr>
<TR>
<TD COLSPAN="2" ALIGN="CENTER">
<TEXTAREA NAME="data:text" WRAP="Off"
...
...
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