Changeset 5979 for main/waeup.sirp/trunk/src/waeup/sirp
- Timestamp:
- 26 Apr 2011, 11:03:36 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/image
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/image/README.txt
r5974 r5979 4 4 The image file widget is built on top of the ImageFile object:: 5 5 6 >>> from waeup.sirp.image import ImageFile7 >>> file = ImageFile('foo.jpg', 'mydata')6 >>> from waeup.sirp.image import WAeUPImageFile 7 >>> file = WAeUPImageFile('foo.jpg', 'mydata') 8 8 >>> file.filename 9 9 'foo.jpg' … … 16 16 'mydata' 17 17 18 We can also create ImageFile objects from file-like objects::18 We can also create WAeUPImageFile objects from file-like objects:: 19 19 20 20 >>> from StringIO import StringIO … … 33 33 'test data' 34 34 35 The ImageFile object normally stores the file data using ZODB35 The WAeUPImageFile object normally stores the file data using ZODB 36 36 persistence. Files can however also be stored by tramline. If 37 37 tramline is installed in Apache, the Tramline takes care of generating … … 70 70 just '1') will now be created:: 71 71 72 >>> file = ImageFile('foo.jpg', '1')72 >>> file = WAeUPImageFile('foo.jpg', '1') 73 73 74 74 The data is now '1', referring to the real file:: … … 99 99 We expect the same behavior as when tramline is not installed:: 100 100 101 >>> file = ImageFile('foo.jpg', 'data')101 >>> file = WAeUPImageFile('foo.jpg', 'data') 102 102 >>> f = file.file 103 103 >>> f.read() -
main/waeup.sirp/trunk/src/waeup/sirp/image/__init__.py
r5975 r5979 3 3 Includings schemas, widgets and the content components. 4 4 """ 5 from waeup.sirp.image.image import ImageFile5 from waeup.sirp.image.image import WAeUPImageFile -
main/waeup.sirp/trunk/src/waeup/sirp/image/image.py
r5976 r5979 25 25 from hurry.file import HurryFile 26 26 from zope.interface import implements 27 from waeup.sirp.image.interfaces import I ImageFile27 from waeup.sirp.image.interfaces import IWAeUPImageFile 28 28 29 class ImageFile(HurryFile):29 class WAeUPImageFile(HurryFile): 30 30 """A file prepared for storing image files. 31 31 32 32 This file type is built upon :class:`hurry.file.HurryFile`. 33 33 """ 34 implements(I ImageFile)34 implements(IWAeUPImageFile) -
main/waeup.sirp/trunk/src/waeup/sirp/image/interfaces.py
r5693 r5979 22 22 """Interfaces for waeup.sirp.image 23 23 """ 24 from zope.app.file.interfaces import IImage 25 from hurry.file.interfaces import IFile, IFileRetrieval 24 from hurry.file.interfaces import IFile, IFileRetrieval, IHurryFile 26 25 27 class IImageFile(IFile , IImage):26 class IImageFile(IFile): 28 27 """Image file field. 29 28 """ 30 29 30 class IWAeUPImageFile(IHurryFile): 31 """Image file. 32 """ 33 31 34 class IImageFileRetrieval(IFileRetrieval): 32 35 """A file retrieval for images. -
main/waeup.sirp/trunk/src/waeup/sirp/image/schema.py
r5972 r5979 25 25 from hurry.file.schema import File 26 26 from waeup.sirp.image.interfaces import IImageFile 27 from waeup.sirp.image.image import ImageFile as ImageFileContent27 from waeup.sirp.image.image import WAeUPImageFile 28 28 29 29 class ImageFile(File): 30 """An image file. 30 """An image file field. 31 32 Suitable for interfaces that wish to store image files in an 33 attribute. 31 34 """ 32 35 implements(IImageFile) 33 36 34 _type = ImageFileContent37 _type = WAeUPImageFile
Note: See TracChangeset for help on using the changeset viewer.