Site Tools


dbus

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

dbus [2015/03/03 20:56]
conovaloff created
dbus [2015/03/03 21:01] (current)
conovaloff
Line 17: Line 17:
 === Фичи === === Фичи ===
  - dbus умеет работать через сеть  - dbus умеет работать через сеть
 +
 +=== Примеры ===
 +Клиент на python:
 +<​code>​
 +import dbus
 + 
 +sys_bus = dbus.SystemBus()
 + 
 +# get an object called / in org.freedesktop.Avahi to talk to
 +raw_server = sys_bus.get_object('​org.freedesktop.Avahi',​ '/'​)
 + 
 +# objects support interfaces. get the org.freedesktop.Avahi.Server interface to our org.freedesktop.Avahi object.
 +server = dbus.Interface(raw_server,​ '​org.freedesktop.Avahi.Server'​)
 + 
 +# The so-called documentation is at /​usr/​share/​avahi/​introspection/​Server.introspect
 +print server
 +print server.GetVersionString() ​ # <- сервис который предоставляет avahi
 +print server.GetHostName() ​ # <- сервис который предоставляет avahi
 +</​code>​
dbus.txt · Last modified: 2015/03/03 21:01 by conovaloff

Page Tools