Changeset 5922 for main/waeup.sirp/trunk/src/waeup/sirp
- Timestamp:
- 11 Apr 2011, 20:41:03 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/image/browser/views.py
r5693 r5922 22 22 """Views for images and the like. 23 23 """ 24 import mimetypes 24 25 import grok 25 26 from hurry.file.interfaces import IHurryFile … … 31 32 32 33 def render(self): 33 self.response.setHeader('Content-Type', 'image/jpeg') 34 print dir(self.context) 35 print self.context.headers 34 """Output the data of context. 35 36 Beside this we set the output MIME type according to the 37 context's filename. 38 """ 39 content_type = mimetypes.guess_type(self.context.filename.lower()) 40 if content_type is not None: 41 self.response.setHeader('Content-Type', content_type) 36 42 return self.context.data
Note: See TracChangeset for help on using the changeset viewer.