Commit bae8e249 authored by Andreas Jung's avatar Andreas Jung

minor cleanup

parent 1f20a939
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
############################################################################## ##############################################################################
"""Image object that is stored in a file""" """Image object that is stored in a file"""
__version__='$Revision: 1.19 $'[11:-2] __version__='$Revision: 1.20 $'[11:-2]
import os import os
import time import time
...@@ -43,9 +43,7 @@ class ImageFile(Acquisition.Explicit): ...@@ -43,9 +43,7 @@ class ImageFile(Acquisition.Explicit):
max_age = 3600 # One hour max_age = 3600 # One hour
self.cch = 'public,max-age=%d' % max_age self.cch = 'public,max-age=%d' % max_age
file=open(path, 'rb') data = open(path, 'rb').read()
data=file.read()
file.close()
content_type, enc=guess_content_type(path, data) content_type, enc=guess_content_type(path, data)
if content_type: if content_type:
self.content_type=content_type self.content_type=content_type
...@@ -84,10 +82,7 @@ class ImageFile(Acquisition.Explicit): ...@@ -84,10 +82,7 @@ class ImageFile(Acquisition.Explicit):
RESPONSE.setStatus(304) RESPONSE.setStatus(304)
return '' return ''
f=open(self.path,'rb') return open(self.path,'rb').read()
data=f.read()
f.close()
return data
HEAD__roles__=None HEAD__roles__=None
def HEAD(self, REQUEST, RESPONSE): def HEAD(self, REQUEST, RESPONSE):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment