Hi!
I'm trying to stream bigger files via web.py, and something is wrong, but I
can't put my finger on it... The code is this:

#!/usr/bin/python
# -*- coding: utf-8 -*-

import magic
import web

m = magic.open(magic.MAGIC_MIME)
m.load()
urls = ("/(.*)", "artwork")
app = web.application(urls, globals())

class artwork:
    def GET(self, path):
        if path:
            f = path.split('/')
            self.openfile(f)

        return web.notfound()

    def openfile(self, f):
        filename = f[2]
        if web.ctx.has_key('HTTP_IF_MODIFIED_SINCE'):
            return web.notmodified()
        else:
            web.ok()
            web.header('Content-Length', os.stat(filename).st_size)

            f = open(filename)
            for line in f:
                yield line


if __name__ == "__main__":
    app.run()

--------

and I get this error:

  File "/www/192.168.1.5/docs/aa/ai/index.py", line 30
    yield line
SyntaxError: 'return' with argument inside generator


Any idea, what's wrong?


And P.S.: webpy.org is throwing a 500 error...
-- 
http://www.wolfhowlmedia.com

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to