tags:

views:

286

answers:

1

When I'm trying to get the idle time of the gnome screensaver in seconds, through dbus, python throws an TypeError.

In the documentation I found for the screensaver sessionIdleTime, it returns a unsigned integer. http://www.gnome.org/~mccann/gnome-screensaver/docs/gnome-screensaver.html#gs-method-GetSessionIdle

However, when I'm in the python shell, the output is converterted to a string, while I can't seen to be able to cast it as a string in the program.

gs = gs = bus.get_object('org.gnome.ScreenSaver','/org/gnome/ScreenSaver') message = str(gs.GetSessionIdleTime())

A: 

str(gs.GetSessionIdleTime()) cast the integer into a string.

And after that, using + in a string variable incorporated it into another dbus call that was called by the output.

CodeJoust