B
    EDbk  ã               @   s   G d d„ de ƒZdS )c               @   s    e Zd ZdZdd„ Zdd„ ZdS )ÚCustomResponseaú  
	In some cases it can be nessecary to override the normal response system and return
	something completely different - ie. 
	1. if a certain method should return a file as a http attachment response for
	   browsers (Content-Disposition: attachment;).
	2. or a commandline tool that sends a SOAP request and should output raw text as
	   result
	Objects of CustomResponse descendents are intercepted in the wsgi_application part
	so the service developer has full control over response headers and data.
	c             C   s   t dƒ‚dS )a,  
		response_headers must return a list of tuple-pairs that will constitute the response
		headers. An example::
			return [
				('Content-Disposition', 'attachment; filename="%s"' % self.filename),
				('Content-Type', 'application/force-download'),
				('Content-Length', str(self.filesize))
			]
		z3CustomResponse.response_headers must be specializedN)ÚNotImplementedError)Úself© r   ú;G:\easytimepro\master/mysite/ladon\server\customresponse.pyÚresponse_headers   s    
zCustomResponse.response_headersc             C   s   t dƒ‚dS )añ  
		response_data is the data part of the response, and must be raw data (str in Python 2,
		bytes in Python 3). Iterator objects are also accepted and should be used when responses
		consist of very large data parts. For instance if the response data is a large file it
		should be returned as a iterator that is generated by reading chunks from a file object::
			self.output = open('/path/to/very/large/file.zip','rb')
			block_size = 4096
			return iter(lambda: output.read(block_size), '')

		z0CustomResponse.response_data must be specializedN)r   )r   r   r   r   Úresponse_data   s    zCustomResponse.response_dataN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r      s   
r   N)Úobjectr   r   r   r   r   Ú<module>   ó    