Advertisement
binooetomo

NAVIT: Enable/Disable OSD Item via dbus using Python

Mar 2nd, 2012
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.19 KB | None | 0 0
  1. '''
  2. I Have OSD Item in my navit.xml :
  3. <osd name="bino01" enabled="yes" type="button" x="0" y="0" command="" src="/home/bino/.navit/skins/Mineque_003/logo.png" />
  4.  
  5. Inside binding_dbus.c of navit, there is (line 1595):
  6. {".osd",    "set_attr",          "sv",      "attribute,value",                         "",    "",  request_osd_set_attr},
  7.  
  8. I try to disabled that osd item using python via dbus. using python
  9.  
  10. '''
  11.  
  12. import dbus
  13. bus = dbus.SessionBus()
  14. conn = bus.get_object('org.navit_project.navit','/org/navit_project/navit')
  15. iface = dbus.Interface(conn, dbus_interface='org.navit_project.navit')
  16. iter=iface.attr_iter()
  17.  
  18. navit=bus.get_object('org.navit_project.navit', conn.get_attr_wi("navit",iter)[1])
  19. iface.attr_iter_destroy(iter)
  20. osd_iface = dbus.Interface(navit, dbus_interface='org.navit_project.navit.osd')
  21.  
  22. aa=osd_iface.set_attr({"name":dbus.String("bino01",variant_level=1),"enabled":dbus.String("no",variant_level=1)})
  23.  
  24. '''
  25. Result :
  26. dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method "set_attr" with signature "a{sv}" on interface "org.navit_project.navit.osd" doesn't exist
  27.  
  28. ------------
  29. Kindly please give me your enlightment to fix this problem
  30.  
  31. '''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement