Annotation of ExtFile/Extensions/PUT_factory.py, revision 1.1.1.1

1.1       dwinter     1: from OFS.Image import getImageInfo
                      2: from Products.ExtFile.ExtImage import ExtImage
                      3: import string
                      4: 
                      5: def PUT_factory(self, name, typ, body):
                      6:     '''Creates ExtImage instead of plain Image.'''
                      7:     ct, w, h = getImageInfo(body)
                      8:     if ct:
                      9:         major, minor = string.split(ct, '/')
                     10:         if major == 'image':
                     11:             return ExtImage(name, '', '')
                     12:     major, minor = string.split(typ, '/')
                     13:     if major == 'image':
                     14:         return ExtImage(name, '', '')
                     15:     return None

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>