Re: Patch for 404 customization

Philip Semanchuk <[email protected]>
Newsgroups gmane.comp.python.spyce.general
Message-ID <[email protected]>
On May 17, 2006, at 3:03 PM, Jonathan Ellis wrote:

> On Tue, 16 May 2006 23:07:48 -0400, "Philip Semanchuk"
> <[email protected]> said:
>> On May 16, 2006, at 11:57 AM, Jonathan Ellis wrote:
>>> On Tue, 16 May 2006 11:24:56 -0400, "Philip Semanchuk"
>>> <[email protected]> said:
>>>> Hi all,
>>>> I have hacked Spyce to permit customization of 404 errors and I'd 
>>>> like
>>>> to hear other people's comments on my code.
>
>>> Hey Philip,
>>>
>>> thanks for the patch.  But I think this is more complicated than it
>>> needs to be.  All you should have to do call spyceFileHandler with 
>>> the
>>> (invalid) path instead of handling the 404 directly in spyceWWW, and 
>>> it
>>> should get routed through the normal exception handling stuff in
>>> commonHandler.  Then the docs would be correct. :)
>
>> You suggestion works great, *but* I can't figure out exactly how to
>> implement it. At the bottom of this email is one diff that gets the 
>> job
>> done for my setup, but I commented out lines 144 and 145 of 
>> spyceWWW.py
>> to make my code work. I can't figure out what those lines were meant 
>> to
>> accomplish, but Spyce's code is pretty tight and so I guess they do
>> *something*. But it seems like any added code that calls "not
>> os.path.exists(path)" will usurp whatever 144 and 145 do.
>
> You're right.  And that's strange.

Indeed, it is most unusual. =)


>   The "search up path until you find
> something that exists" doesn't fit my sense of correct behavior, 
> either.
>  Rimon added that back in 2003, before my time.  I'll take it out for
> 2.1.

Great, thank you!

Cheers
Philip






-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.