mò
rÄFc           @   sZ   d  Z  d k l Z d k l Z d k l Z d k Z d e f d „  ƒ  YZ e e ƒ d S(   s„   ExtPhotoImage

This is used as a wrapper for Photo to provide a common interface
for both Zope Image objects and ExtImage objects.

(   s   ClassSecurityInfo(   s   InitializeClass(   s   ExtImageNt
   PhotoImagec           B   sæ   t  Z d  Z e ƒ  Z d d d d d d „ Z d „  Z d „  Z d „  Z d „  Z	 e i
 d d ƒ d	 „  Z d
 „  Z e i
 d d ƒ d „  Z d „  Z e Z d „  Z d „  Z d „  Z d „  Z e i
 d d ƒ d „  Z d d „ Z RS(   s   Interface to ExtImage.t    c         C   s&   | |  _ t i d ƒ |  | | ƒ d  S(   Nt   __init__(   t   patht   selft   _pathR    t   inheritedAttributet   idt   content_type(   R   R   t   titlet   fileR   t   preconditionR   (    (    tB   /home2/kennisonb/webapps/zope/Zope/Products/Photo/ExtPhotoImage.pyR   ,   s    	c         C   s
   |  i ƒ  S(   N(   R   t   height(   R   (    (    R   t   _height0   s    c         C   s
   |  i ƒ  S(   N(   R   t   width(   R   (    (    R   t   _width3   s    c         C   s   |  i S(   N(   R   R   (   R   (    (    R   t   _content_type6   s    c         C   s
   |  i ƒ  S(   N(   R   t   rawsize(   R   (    (    R   t   _size9   s    s   Access contents informationt   sizec         C   s
   |  i ƒ  S(   N(   R   R   (   R   (    (    R   R   =   s    c         C   s4   |  i ƒ  i ƒ  d } t i ƒ  d } t | | ƒ S(   Ni<   (   R   t   bobobase_modification_timet   timeTimet   mtimet   timet   nowt   int(   R   R   R   (    (    R   t   _age@   s    t   Viewt
   index_htmlc         C   s   t  i d ƒ |  d | d | ƒS(   NR   t   REQUESTt   RESPONSE(   R    R   R   R   R   (   R   R   R   (    (    R   R   F   s    c         C   s   t  |  i |  i ƒ d ƒ i ƒ  S(   Nt   rb(   t   openR   t   _get_filenamet   filenamet   read(   R   (    (    R   t   _dataI   s    c         C   s   |  i i ƒ  } t | d ƒ S(   NR    (   R   t	   _originalR"   R#   R!   (   R   R#   (    (    R   t   data_as_streamN   s    c         C   s   |  i |  i ƒ S(   N(   R   R"   R#   (   R   (    (    R   t   _PILdataR   s    c         C   s,   t  | d | ƒ} | i | |  i ƒ  ƒ | S(   NR   (   R    R   R   t   imgt   manage_file_uploadR
   R   R   (   R   R   R
   R   R)   (    (    R   t	   _newImageU   s    c         C   s!   |  i ƒ  o |  i ƒ  o |  i S(   N(   R   R   R   R   (   R   (    (    R   t   _isValidZ   s    s   Change Photot   manage_uploadc         C   s   |  i | | ƒ S(   N(   R   R*   R
   R   (   R   R
   R   (    (    R   R-   ^   s    i    c         C   s   |  i d |  i S(   Nt   /(   R   R   R   (   R   t   relative(    (    R   t   absolute_urlf   s    (   t   __name__t
   __module__t   __doc__t   ClassSecurityInfot   securityR   R   R   R   R   t   declareProtectedR   R   R   R%   t   _IMdataR'   R(   R+   R,   R-   R0   (    (    (    R   R    '   s*    														(   R3   t   AccessControlR4   t   Globalst   InitializeClasst   ExtImageR   R    (   R;   R    R4   R:   R   (    (    R   t   ?   s   	B