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
f6f699fd
Commit
f6f699fd
authored
Mar 10, 1998
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed last-modified again from Image and File objects, because
Netscape is dumb.
parent
cdeba7a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
24 deletions
+1
-24
lib/python/OFS/Image.py
lib/python/OFS/Image.py
+1
-24
No files found.
lib/python/OFS/Image.py
View file @
f6f699fd
"""Image object"""
__version__
=
'$Revision: 1.3
1
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.3
2
$'
[
11
:
-
2
]
import
Globals
from
Globals
import
HTMLFile
,
MessageDialog
...
...
@@ -68,39 +68,19 @@ class File(Persistent,Implicit,RoleManager,Item_w__name__):
self
.
__name__
=
id
self
.
title
=
title
self
.
size
=
len
(
self
.
data
)
self
.
setLastModifiedHeader
()
def
id
(
self
):
return
self
.
__name__
def
getLastModifiedHeader
(
self
):
"""Return a timestamp string representing the last
modification time, in a format that can used in
an HTTP header."""
if
hasattr
(
self
,
'hmod'
):
return
self
.
hmod
self
.
hmodified
=
DateTime
().
toZone
(
'GMT'
).
rfc822
()
return
self
.
hmodified
def
setLastModifiedHeader
(
self
,
ts
=
None
):
"""Set the timestamp string representing the last
modification time to the given string. The time
stamp string must be expressed in GMT, in rfc822
format. If no string is specified, a timestamp
representing the current time will be used."""
if
ts
:
self
.
hmodified
=
ts
else
:
self
.
hmodified
=
DateTime
().
toZone
(
'GMT'
).
rfc822
()
def
index_html
(
self
,
RESPONSE
):
""" """
RESPONSE
[
'content-type'
]
=
self
.
content_type
RESPONSE
[
'last-modified'
]
=
self
.
getLastModifiedHeader
()
return
self
.
data
def
manage_edit
(
self
,
title
,
content_type
,
REQUEST
=
None
):
""" """
self
.
title
=
title
self
.
content_type
=
content_type
self
.
setLastModifiedHeader
()
if
REQUEST
:
return
MessageDialog
(
title
=
'Success!'
,
message
=
'Your changes have been saved'
,
...
...
@@ -112,7 +92,6 @@ class File(Persistent,Implicit,RoleManager,Item_w__name__):
data
=
file
.
read
()
self
.
data
=
Pdata
(
data
)
self
.
size
=
len
(
data
)
self
.
setLastModifiedHeader
()
if
REQUEST
:
return
MessageDialog
(
title
=
'Success!'
,
message
=
'Your changes have been saved'
,
...
...
@@ -122,7 +101,6 @@ class File(Persistent,Implicit,RoleManager,Item_w__name__):
def
HEAD
(
self
,
REQUEST
,
RESPONSE
):
""" """
RESPONSE
[
'content-type'
]
=
self
.
content_type
RESPONSE
[
'last-modified'
]
=
self
.
getLastModifiedHeader
()
return
''
PUT__roles__
=
[
'Manager'
]
...
...
@@ -130,7 +108,6 @@ class File(Persistent,Implicit,RoleManager,Item_w__name__):
'handle PUT requests'
self
.
data
=
Pdata
(
BODY
)
self
.
size
=
len
(
BODY
)
self
.
setLastModifiedHeader
()
try
:
type
=
REQUEST
[
'CONTENT_TYPE'
]
if
type
:
self
.
content_type
=
type
...
...
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