twisted / nevow

Web Application Construction Kit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

evalAfterDone arg from nevow_closeLive does not run

mikedawson opened this issue · comments

Hi,

Nevow is used in the eXeLearning project; I've been working on upgrading it from the ancient version it used before. I think there is a mistake in how the nevow_closeLive function is written:

The function takes an arg by the name of evalAfterDone - which looking at the implementation of nevow_clientToServerEvent is a javascript function that runs after the clientToServerEvent is done, regardless of the result and is not passed to the server.

But in the implementation of nevow_closeLive evalAfterDone is the third parameter, not the second. This results in the evalAfterDone argument being passed to the server as an argument and not treated as evalAfterDone by the nevow_clientToServerEvent function. As far as I can see:

nevow_clientToServerEvent('close', '', evalAfterDone)

Should actually be:

nevow_clientToServerEvent('close', evalAfterDone, '')
or just:
nevow_clientToServerEvent('close', evalAfterDone)

Perhaps I have missed something about how the close event is supposed to be handled... but it seems strange that this argument would be called the same thing in both functions and then switch around.

Will look forward to finding out if this is the case or if I have after reading the docs in livepage misunderstood how close is supposed to work.

Thanks,

-Mike

nevow.livepage was essentially superseded by nevow.athena about ... 9 years ago. Unfortunately it's not formally deprecated in the standard way (it doesn't use Python's warnings system to emit a DeprecationWarning) but the module docstring does caution against using it.

Please take a look at nevow.athena and see if it is suitable for your needs. Alternatively, you might be interested in https://ludios.org/minerva/ (the web page says that it is no longer maintained but an honest description of nevow.athena would be the same; don't necessarily look at either of these facts as a reason not to use the libraries but rather as an invitation to contribute to the maintenance effort).

Hi,

Thanks for the quick reply there; I will check out as soon as possible migrating to the nevow.athena module. I think that is what's needed - will see how much adaptation work is required.

Thanks

-Mike