*i can't look at the website to research it, but what's "MAGIC?"*
*btw, i get*
*
@mini64:~/public_html/webpy_testing$ python large_files.py
  File "large_files.py", line 30
    yield line
SyntaxError: 'return' with argument inside generator

i drop the yeild and pass it, and i get no module named magic

curious - very interesting.
*-----------------------
Visit
http://www.superantispyware.com/superantispyware.html?rid=3971 Remove All
The Spyware - Not Just The Easy Ones!
http://1-4-u.info | Don't send insanely long links!
Need a Pick-Me-Up? http://quotes.feedtheguru.com



On Mon, Jun 14, 2010 at 5:11 PM, Primoz Anzur <[email protected]>wrote:

> 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] <webpy%[email protected]>.
> For more options, visit this group at
> http://groups.google.com/group/webpy?hl=en.
>

-- 
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