Python extension api weirdness…?
by Mark Hurenkamp
Lately I’ve been away from python, mostly due to the fact that the Publish & Subscribe interface is not available in PyS60, and I would realy love to use that to retrieve charging status, but also as a means of propagating information throughout my application, and sharing info between applications.
So I started to work with Carbide C++, the Symbian 3rdFp1 SDK, and all that… installed it in a windows virtual machine (since I’m on a Mac), and after some time I got an extension to work properly from the emulator.
Then tried it on the N95… Crash!… of course, I made some mistakes, so I fixed them. Then … Crash! … of course, the emulator ignores the security model… and on the device it needs to be handled right.
Finally, I got something to work on the device as well, it is not perfect yet, but usuable for at least the retrieval of several settings, amoungst which the ‘ChargerState’ 🙂
One of the weird things I can’t explain is that when I define a class (Property) in my extension, it seems that the first method doesn’t parse the arguments properly. It keeps telling me method xxx requires no parameters (3 given)…
Adding a dummy top entry to the method table makes the problem go away…
If anyone can give an explanation for this behaviour, please do not hesitate to let me know!
Related posts:
- Easy OpenSign with Firefox Extension! Does Opensign Online seem a pain to you ?...
- Landmarks API extension for PyS60 A PyS60 extension API for manipulating landmarks was released by...
Related posts brought to you by Yet Another Related Posts Plugin.
That is weird!
If number of arguments was a problem, it shouldn’t go away when a dump entry was added at the top.
I wonder what type of arguments you are passing?
The code can be found here: http://code.google.com/p/tracker-py/source/browse/trunk/properties/src/properties.cpp
Commenting out line 313, rebuild, and run on my N95 results in Property.Attach not accepting arguments anymore…
The same happened when I had a static Define function in place (_dummy_ still points to it, and similarly refuses any parameters…)
In the latest version (svn 493), that would be line 301 iso 313.