no the old way of specifying funciton is very useful and '/(.*)', 'notfound' this is not pythonic
________________________________ From: Anand Chitipothu <[EMAIL PROTECTED]> To: [email protected] Sent: Saturday, November 1, 2008 4:48:20 PM Subject: [webpy] Re: customizing not found message > What if people want to programmatically generate the notfound message, > perhaps to see if the URL was a typo and suggest nearby URLs? > > What if people want notfound messages to have side effects, like be > added to a database so they can see the most popular 404s and add > redirects for them? > > What if people want different notfound messages for different applications? If we support that then changing notfound message for a website may involve setting notfound for each individual app that is used. I think dynamic notfound message is a rare case and can be handled by adding handler for .*. urls = ( '/foo', 'foo', '/(.*)', 'notfound' ) app = web.application(urls, globals()) class notfound: def GET(self, name): web.ctx.status = '404 Not Found' return 'Unable to find %s. Did you mean "foo"?" % repr(name) Isn't this good enough? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
