Fwd: bug in python plasmoid tutorial

Maik Beckmann beckmann.maik at googlemail.com
Fri Sep 18 22:23:36 CEST 2009

2009/9/18 Aaron J. Seigo <aseigo at kde.org>:
> 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()

hm, in case data[QString("Charge Percent") is a list, yes.

>> 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.

 I must have been mislead by
  "ERROR: syntax error"
in the output :P

 -- Maik

PS: Sorry for not investigating more deeply myself.  I was kind of
scared by seeing this as my first experience with the python bindings,
so a brought this up to get some information about the status of it.
I guess I should have added this question to my posting, but I didn't
wanted to sound offensive at my first posting to the list.

More information about the Plasma-devel mailing list