- Timestamp:
- 6 Jun 2011, 02:31:41 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/image/image.py
r5979 r6284 23 23 Components for handling image files. 24 24 """ 25 from StringIO import StringIO 25 26 from hurry.file import HurryFile 27 from hurry.file.interfaces import IFileRetrieval 28 from zope.component import queryUtility 26 29 from zope.interface import implements 27 30 from waeup.sirp.image.interfaces import IWAeUPImageFile … … 33 36 """ 34 37 implements(IWAeUPImageFile) 38 39 def _get_file(self): 40 """Get the real file. 41 42 We have to override this method from 43 :class:`hurry.file.HurryFile` base because we need a more 44 careful utility lookup. 45 """ 46 storage = queryUtility(IFileRetrieval) 47 if storage is None: 48 # can happen on startup, see https://trac.waeup.org/ticket/32 49 return StringIO(self.data) 50 return storage.getFile(self.data) 51 52 file = property(_get_file)
Note: See TracChangeset for help on using the changeset viewer.