[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    [tutorial][python] problems with self.engine.connectSource
From:       Maik Beckmann <beckmann.maik () googlemail ! com>
Date:       2009-08-10 19:01:07
Message-ID: 200908102101.07526.Beckmann.Maik () googlemail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello,

The code in this tutorial
  - http://techbase.kde.org/Development/Tutorials/Plasma/PythonPlasmoid
after getting it to work by changing
  charge = data[QString("Charge Percent")].toInt()[0]
to
  charge = data[QString("Charge Percent")] 
gives
{{{ 
Connecting to battery 
/org/freedesktop/Hal/devices/computer_power_supply_battery_BAT0
Unrecognized character: /                                                            
Unrecognized character: /                                                            
ERROR: syntax error
}}}

The line which triggers this is 
  self.engine.connectSource(battery, self)

What's wrong?

-- Maik

PS; kde-4.3 on arch linux.

[Attachment #5 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" \
content="1" /><style type="text/css">p, li { white-space: pre-wrap; \
}</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; \
font-weight:400; font-style:normal;">Hello,<br> <p style="-qt-paragraph-type:empty; \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>The code in this \
                tutorial<br>
  - http://techbase.kde.org/Development/Tutorials/Plasma/PythonPlasmoid<br>
after getting it to work by changing<br>
  <span style=" font-family:'monospace';">charge = data</span><span style=" \
font-family:'monospace'; color:#000000;">[</span><span style=" \
font-family:'monospace';">QString</span><span style=" font-family:'monospace'; \
color:#000000;">(</span><span style=" font-family:'monospace'; \
color:#483d8b;">"Charge Percent"</span><span style=" font-family:'monospace'; \
color:#000000;">)]</span><span style=" font-family:'monospace';">.</span><span \
style=" font-family:'monospace'; color:#000000;">toInt()[</span><span style=" \
font-family:'monospace';">0</span><span style=" font-family:'monospace'; \
color:#000000;">]</span><br> to<br>
  charge = data[QString("Charge Percent")] <br>
gives<br>
{{{ <br>
Connecting to battery \
/org/freedesktop/Hal/devices/computer_power_supply_battery_BAT0<br> Unrecognized \
character: /                                                            <br> \
Unrecognized character: /                                                            \
                <br>
ERROR: syntax error<br>
}}}<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>The line which triggers this is <br>  \
self.engine.connectSource(battery, self)<br> <p style="-qt-paragraph-type:empty; \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>What's wrong?<br> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>-- \
Maik<br> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>PS; kde-4.3 on arch linux.</p></body></html>



_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic