here's my code:
class static:
def GET(self, tail):
if os.path.exists('static\\'+tail):
sys.stdout.write(open('static\\'+tail,'r').read())
else:
web.webapi.notfound()
print open('404.html','r').read()
ok, i'm trying to test if the file exists in the static directory, and if
so, send it, and if not, give a 404 response and send 404.html (so that i
can have uri's without the retarded 'static/' in them)
the problem is it sends 'not found' followed immediately by the contents of
404.html. i don't want the 'not found' there.
that's not the only problem, though. it doesn't necessarily work right when
the file actually is there either.
i tried loading some images i have in the static directory, and with images
that are there, 3 different things can happen.
1. the images shows correctly
2. i get a blank page
3. i get something like: The image "http://localhost:8080/vline2.png" cannot
be displayed, because it contains errors.
*wonders when the day will come that programming isn't such a pain in the
arse*
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---