[Twisted-Python] wxpython and xmlrpc via twisted

Ian Jones ian at ambientdivide.com
Tue Dec 9 16:27:00 MST 2008


I'm trying to create a taskbar app (in wxpython) to monitor job
progress on a render farm. I'd like the taskbar app to have an xmlrpc
server built in so that other applications can inform the taskbar app
additional jobs to monitor.

I found this recipe online which is a great example of the functionality I want:

http://code.activestate.com/recipes/298985/

However when I run the following

from xmlrpclib import *
s = ServerProxy('http://localhost:7080') # Get access to xmlrpc server
s.title('Hallo xmlrpc app')

I don't get a response (though the title in the window changes - so I
know it got it)

I do get this though:

Traceback (most recent call last):
  File "d:\toolkit\sww\win32\python\2.4\lib\site-packages\twisted-8.1.0-py2.4-win32.egg\twisted\protocols\basic.py",
line 239, in dataReceived
    return self.rawDataReceived(data)
  File "d:\toolkit\sww\win32\python\2.4\lib\site-packages\twisted-8.1.0-py2.4-win32.egg\twisted\web\http.py",
line 1117, in rawDataReceived
    self.allContentReceived()
  File "d:\toolkit\sww\win32\python\2.4\lib\site-packages\twisted-8.1.0-py2.4-win32.egg\twisted\web\http.py",
line 1108, in allContentReceived
    req.requestReceived(command, path, version)
  File "d:\toolkit\sww\win32\python\2.4\lib\site-packages\twisted-8.1.0-py2.4-win32.egg\twisted\web\http.py",
line 626, in requestReceived
    self.process()
--- <exception caught here> ---
  File "d:\toolkit\sww\win32\python\2.4\lib\site-packages\twisted-8.1.0-py2.4-win32.egg\twisted\web\server.py",
line 150, in process
    self.render(resrc)
  File "d:\toolkit\sww\win32\python\2.4\lib\site-packages\twisted-8.1.0-py2.4-win32.egg\twisted\web\server.py",
line 157, in render
    body = resrc.render(self)
  File "d:\toolkit\sww\win32\python\2.4\lib\site-packages\twisted-8.1.0-py2.4-win32.egg\twisted\web\resource.py",
line 189, in render
    return m(request)
  File "d:\toolkit\sww\win32\python\2.4\lib\site-packages\twisted-8.1.0-py2.4-win32.egg\twisted\web\xmlrpc.py",
line 122, in render_POST
    function = self._getFunction(functionPath)
  File "d:\toolkit\sww\win32\python\2.4\lib\site-packages\twisted-8.1.0-py2.4-win32.egg\twisted\web\xmlrpc.py",
line 170, in _getFunction
    handler = self.getSubHandler(prefix)
  File "d:\toolkit\sww\win32\python\2.4\lib\site-packages\twisted-8.1.0-py2.4-win32.egg\twisted\web\xmlrpc.py",
line 107, in getSubHandler
    return self.subHandlers.get(prefix, None)
exceptions.AttributeError: 'MyXMLRPCApp' object has no attribute 'subHandlers'
Unhandled error in Deferred:
Traceback (most recent call last):
  File "d:\toolkit\sww\win32\python\2.4\lib\site-packages\twisted-8.1.0-py2.4-win32.egg\twisted\web\resource.py",
line 189, in render
    return m(request)
  File "d:\toolkit\sww\win32\python\2.4\lib\site-packages\twisted-8.1.0-py2.4-win32.egg\twisted\web\xmlrpc.py",
line 126, in render_POST
    defer.maybeDeferred(function, *args).addErrback(
  File "d:\toolkit\sww\win32\python\2.4\lib\site-packages\twisted-8.1.0-py2.4-win32.egg\twisted\internet\defer.py",
line 195, in addCallback
    callbackKeywords=kw)
  File "d:\toolkit\sww\win32\python\2.4\lib\site-packages\twisted-8.1.0-py2.4-win32.egg\twisted\internet\defer.py",
line 186, in addCallbacks
    self._runCallbacks()
--- <exception caught here> ---
  File "d:\toolkit\sww\win32\python\2.4\lib\site-packages\twisted-8.1.0-py2.4-win32.egg\twisted\internet\defer.py",
line 328, in _runCallbacks
    self.result = callback(self.result, *args, **kw)
  File "d:\toolkit\sww\win32\python\2.4\lib\site-packages\twisted-8.1.0-py2.4-win32.egg\twisted\web\xmlrpc.py",
line 144, in _cbRender
    allow_none=self.allowNone)
exceptions.AttributeError: 'MyXMLRPCApp' object has no attribute 'allowNone'

I'm assuming this is just a good example that is out of date. However
I'm not sure how to update it so that it works. Can someone help me
out?




More information about the Twisted-Python mailing list