Fwd: bug in python plasmoid tutorial

Aaron J. Seigo aseigo at kde.org
Fri Sep 18 21:41:08 CEST 2009

On September 18, 2009, Matt Williams wrote:
> http://osdir.com/ml/plasma-devel/2009-08/msg00220.html

the real problem there looks like:

charge = data[QString("Charge Percent")].toInt()[0]

is trying to treat toInt() as returning an array. i'm not a pythonista, but 
i'd expect the correct code to be:

charge = data[QString("Charge Percent")][0].toInt()

> connecting to battery
> /org/freedesktop/Hal/devices/computer_power_supply_battery_C1F3
> Unrecognized character: /
> Unrecognized character: /
> ERROR: syntax error
> Charge: 80%
> Object::disconnect: No such slot
> QObject::dataUpdated(QString,Plasma::DataEngine::Data)
> Object::disconnect:  (sender name:
> '/org/freedesktop/Hal/devices/computer_power_supply_battery_C1F3')

none of these are actually fatal or even errors afaik.

Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20090918/70f31251/attachment-0001.sig 

More information about the Plasma-devel mailing list