I have a django application running under twisted.
I have server.py with the following code: http://slexy.org/view/s21TBxGPut
When I run server.py with twisted I get the following exception: http://slexy.org/view/s2WqQDMvsh
The exception is caused by the last 2 lines in server.py. If I comment these lines, I have no exception.
I have no idea how to debug such thing.
Maybe someone has an idea what am I doing wrong?
Thanks a lot, Arshavski Alexander.
Your
TimerServiceis constructed wrong:This is the same as:
What does
call_commandreturn? It’s not part of your paste, but since your exception is:I’m going to guess that it returns
None. AndNoneis not callable, as the exception points out.You set up the first
TimerServicecorrectly:Notice that you’re not calling
check_all_notificationsin that statement. You’re passing it toTimerService. You need to do the same for your other service:It just so happens that
TimerServiceis constructed to support calling a function with some arguments, so it accepts both the callable and arbitrary extra arguments and passes those arguments on to the callable whenever it is time to call it.