[LDTP-Dev] Callback example raises exception.

Wang Qi, Scott wangqi.s at gmail.com
Sat Nov 14 19:13:50 PST 2009


Hi,

I tried the callback example at
http://ldtp.freedesktop.org/user-doc/index.html on Ubunt 9.04 with LDTP
1.7.1.

It seems as soon as the first callback function 'cb' is triggered. It raise
a exception.

>>> onwindowcreate('Replace', cb)
1
>>> onwindowcreate('dlgFind', cbwithvarargs, 'test', 'var', 'args')
1
>>> click('*gedit', 'btnReplace')
1
>>> Unhandled exception in thread started by <function invokecallback at
0xa4f087c>
Traceback (most recent call last):
  File "/var/lib/python-support/python2.6/ldtp.py", line 351, in
invokecallback
    callback = _callbackFunctions.get (_responseData [1])[0]
TypeError: 'NoneType' object is unsubscriptable

But the callback with arguments works just fine. Is this a bug?

Another observation is that it seems the default gedit installed with Ubuntu
9.04 only allow a single dialog to be pop-up in front of main window.

click('*gedit', 'btnReplace') # This will pop up the Replace dialog.
click('*gedit', 'btnFind') # But this one only highlight the Find button.

Therefore, this example may not work any more as intended originally.

Thanks
Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/ldtp-dev/attachments/20091115/64221768/attachment.html 


More information about the LDTP-dev mailing list