The Following User Says Thank You to mortak For This Useful Post: | ||
|
2010-07-14
, 07:22
|
Posts: 21 |
Thanked: 8 times |
Joined on Dec 2009
|
#3
|
import gobject import dbus from dbus.mainloop.glib import DBusGMainLoop import subprocess def Wlan_StDis(interf): acc_r=subprocess.Popen('/usr/bin/dbus-send --type=method_call --print-reply --dest=org.freedesktop.Telepathy.AccountManager /org/freedesktop/Telepathy/AccountManager org.freedesktop.DBus.Properties.Get string:org.freedesktop.Telepathy.AccountManager string:ValidAccounts | grep -m 1 skype', shell=True, stdout=subprocess.PIPE, ).communicate()[0] acc = acc_r[22:-2] print acc bus= dbus.SessionBus() accm = bus.get_object('org.freedesktop.Telepathy.AccountManager', acc) accm.Set('org.freedesktop.Telepathy.Account', 'RequestedPresence', \ dbus.Struct(( dbus.UInt32(1) , 'Offline', 'Disconnect by script' ), signature='uss'), dbus_interface='org.freedesktop.DBus.Properties') DBusGMainLoop(set_as_default=True) dbus.SystemBus().add_signal_receiver(Wlan_StDis,dbus_interface=None,signal_name="disconnected",bus_name="com.nokia.wlancond",path="/com/nokia/wlancond/signal",) gobject.MainLoop().run()
The Following 2 Users Say Thank You to VII For This Useful Post: | ||
|
2010-07-14
, 07:46
|
Posts: 1 |
Thanked: 0 times |
Joined on Jul 2010
|
#4
|
|
2010-07-14
, 08:04
|
|
Posts: 762 |
Thanked: 395 times |
Joined on Jan 2010
@ Helsinki
|
#5
|
|
2010-07-14
, 08:10
|
Posts: 21 |
Thanked: 8 times |
Joined on Dec 2009
|
#6
|
|
2010-07-14
, 08:14
|
Posts: 21 |
Thanked: 8 times |
Joined on Dec 2009
|
#7
|
Man, I'd really like the dev of AutoDisconnect to pick this feature up.
I'm really vouching for that app to become the ultimate connections manager for Maemo. VII, would you be interested in dropping that line to the AutoDisconnect developer?
|
2010-07-14
, 08:39
|
Posts: 68 |
Thanked: 16 times |
Joined on Feb 2007
|
#8
|
Sure anyone who wants to make something of this script is encouraged.
As of right now it is not fully tested!
Futher I do not know if AutoDisconnect is writen in python or if the developer will like the way this works.
|
2010-07-14
, 08:42
|
Posts: 68 |
Thanked: 16 times |
Joined on Feb 2007
|
#9
|
|
2010-07-14
, 09:38
|
Posts: 21 |
Thanked: 8 times |
Joined on Dec 2009
|
#10
|
i was told that this should be possible via dbus, but my dbus knowledge is very limited.
is anyone willing to implement that or is it impossible?
tia mortak