| Reply | « Previous Thread | Next Thread » |
|
Join Date: Jul 2007
Posts: 159
Location: Eindhoven, the Netherlands
Offline
Regular Contributor
|
|
Hi,
Having been unable to find an extension that implements an interface to get at the hwrmpowerstate items (at least the ChargerStatus), I decided it was time to dive into python extension writing myself. The result is a generic interface to the RProperty class (which implements the Publish & Subscribe interface in Symbian C++). With this extension you can get at the KHWRMBatteryLevel, KHWRMBatteryStatus, and KHWRMChargingStatus keys of the KPSUidHWRMPowerState category. (of course, since it is a generic interface, you can get at other categories & keys as well) Now this code is not perfect yet, it crashes python when you exit the interpreter, and there may be some other issues, however, it works for me, I can get at the chargerstatus settings, and can even subscribe to changes. Open Issues: 1) Exit code & Error handling is not properly done everywhere, causing an error upon exit of the interpreter 2) Access rights are set to their defaults upon creation. This may not allow you to share properties between processes. Sources can be found here: http://code.google.com/p/tracker-py/...properties/src Unsigned SIS can be found here: http://code.google.com/p/tracker-py/...properties.sis Update: Zip package for Module Repository can be found here: http://code.google.com/p/tracker-py/...properties.zip Currently, I have only support for 1.9.x releases of python. A port to 1.4.5 is in the works, but for those eager to port it themselves, here are some tips from an earlier port: http://discussion.forum.nokia.com/fo...d.php?t=169265 Regards, Mark.
Last edited by hurenkam : 2009-06-30 at 22:00.
|
|
Great!
![]() Quote:
Long story: Instead of distributing your extension as unsigned sis, can you please distribute the PYD in some archive so that application developers who would need your extension would just extract it on their PC and directly import it in their application - and guess what - this is possible with Module Repository! So, all you need to do is create a directory named "properties" under dev-modules directory(I'm guessing you have installed either the tar or setup.exe of 1.9.x) and place the kf_properties.pyd there. Now zip the directory "properties" and you should distribute _this_ archive. Now anyone who wants to use your extension just needs to extract this zip(any archive format can be used) into the dev-modules directory on their PC. They can then do "import properties" in their application and when they use PyS60 application packager to create a sis, the application packager will scan the dev-modules directory for properties and automatically package this PYD with their application. Another important thing to note is that it will modify the capabilities of the PYD to match that of the EXE thus eliminating the numerous KErrPermissionDenied errors which users see because of capability mismatches between PYDs(extension modules) and EXE(their application). import antigravity |
| ashwinurao |
| View Public Profile |
| Find all posts by ashwinurao |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
hello Mark
thanks for developing this great extension ![]() i will soon put my comments on this once i check the module. ![]() Enjoy Pythoning Gaba88 Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
Join Date: Jul 2007
Posts: 159
Location: Eindhoven, the Netherlands
Offline
Regular Contributor
|
|||
|
Quote:
Quote:
Quote:
running in a VirtualBox, with Carbide C++, 3rdFp1 SDK and Python 1.9.5 SDK. Connecting my N95 to the virtual machine is impossible, so I really can't use any fancy installers, I depend solely on sis packages to be installed from the phone filemanager. When I have some time, I will see what I can do to prepare such a package. It would help if there is a command available that I can run from the commandline which will just create it for me (just like I can run makesis properties.pkg to create a sis file). Mark. |
|
Ah, what I meant was in a zip format so that users will extract it to their module repository.
Quote:
Quote:
Although this is only useful for application developers and not extension developers since SDK and other stuff is not available. Quote:
To create a module repo compliant package all you need to do right now is - 1. Create directory named "properties". 2. Place kf_poperties.pyd in it. 3. Zip it. 4. Upload the zip and announce the link ![]() import antigravity |
| ashwinurao |
| View Public Profile |
| Find all posts by ashwinurao |
|
Join Date: Jul 2007
Posts: 159
Location: Eindhoven, the Netherlands
Offline
Regular Contributor
|
||
|
Quote:
Quote:
http://code.google.com/p/tracker-py/...properties.zip Good luck! Mark. |
|
Join Date: Jul 2007
Posts: 159
Location: Eindhoven, the Netherlands
Offline
Regular Contributor
|
|
I just uploaded an update, v1.0.2 now also has a Cancel method that can be used to cancel a subscribe. When properly used (every subscribe is properly cancelled) this version exits without generating errors.
Will try tomorrow how this works with 1.9.6... |
|
Join Date: Jul 2007
Posts: 159
Location: Eindhoven, the Netherlands
Offline
Regular Contributor
|
|
I did some more tweaking with the module, and posted another updated version 1.0.3:
http://code.google.com/p/tracker-py/downloads/list Also I put up an initial wiki page describing the module: http://code.google.com/p/tracker-py/wiki/Properties Regards, Mark. |
|
Hmph,
I think this might be something really interesting for me, too... but not sure, so got to ask: could you please give a reference where to find that "RProperty C++ class" documentation? I can't find it with S60 5th Edition SDK ![]() One specific question, could I use it for this purpose: Quote:
--jouni |
|
Join Date: Jul 2007
Posts: 159
Location: Eindhoven, the Netherlands
Offline
Regular Contributor
|
||
|
Quote:
http://library.forum.nokia.com/index...2DC40ADB0.html And also on the wiki: http://wiki.forum.nokia.com/index.ph...or_subscribing http://wiki.forum.nokia.com/index.ph...for_publishing Quote:
Regards, Mark. |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| [Announce] pygame for S60 for PyS60 1.9.x | GameDude | Python | 55 | 2009-10-15 08:30 |
| Read Config / Properties/ XML File in J2ME | sandeepkumar03 | Mobile Java General | 2 | 2009-01-21 12:19 |
| Nokia-specific Java system properties | sgerogia | Mobile Java General | 6 | 2005-05-03 14:17 |
| Browser Properties with WML | vvsnaresh | Mobile Java General | 0 | 2005-01-18 15:51 |
| Nokia-specific Java system properties | sgerogia | Mobile Java General | 0 | 2002-11-22 10:32 |