← Back to team overview

lottanzb team mailing list archive

[Bug 435422] Re: Provide an option to stop the computer when all downloads are completed

 

Marcel is right that you can't shut down the system using the shutdown
command without root privileges. GNOME panel shut down the system by
contacting a daemon with root privileges via DBUS.

So in Gnome (and I think it will also work in KDE) you can shutdown the
system by calling the shutdown method on this DBUS Service:
org.freedesktop.PowerManagement

code should look something like these:

objectPath = '/org/freedesktop/PowerManagement'
busName = 'org.freedesktop.PowerManagement'
bus = dbus.SessionBus()
pm = bus.get_object(busName, objectPath)
pm.Shutdown()

other methods available are:Hibernate() ,Suspend(), Reboot()

haven't tested it yet because then I couldn't complete this message :)
but it should work... problem is that it might not work on other Desktop
envierments.

-- 
Provide an option to stop the computer when all downloads are completed
https://bugs.launchpad.net/bugs/435422
You received this bug notification because you are a member of LottaNZB
Development Team, which is subscribed to LottaNZB.

Status in LottaNZB • Automated Usenet Client: Confirmed

Bug description:
Not a bug but a feature request. Title is pretty self-explanatory I think.



References