|
Fix Version/s
|
|
3.3
[ 12310101
]
|
|
Environment
|
|
|
|
Fix Version/s
|
3.2
[ 11060
]
|
|
|
Description
|
Suppose this function in a published module :
def index(req)
req.content_type = 'text/plain'
yield '1\n'
yield '2\n'
yield '3\n'
yield '4\n'
When published, this module should return a text content with '1\n2\n3\n4\n'.
This could also be useful with a file() object, since they are iterable ; this would provide another way to send a file, only slightly less performing than the send_file() method. Handy when you want to filter a file :
def filter(req,filename):
f = open(filename,'r')
for line in f:
yield re.sub('foo','bar',line)
|
Suppose this function in a published module :
def index(req)
req.content_type = 'text/plain'
yield '1\n'
yield '2\n'
yield '3\n'
yield '4\n'
When published, this module should return a text content with '1\n2\n3\n4\n'.
This could also be useful with a file() object, since they are iterable ; this would provide another way to send a file, only slightly less performing than the send_file() method. Handy when you want to filter a file :
def filter(req,filename):
f = open(filename,'r')
for line in f:
yield re.sub('foo','bar',line)
|