5 p
= bus
.get_object("uk.org.thekelleys.dnsmasq", "/uk/org/thekelleys/dnsmasq")
6 l
= dbus
.Interface(p
, dbus_interface
="uk.org.thekelleys.dnsmasq")
8 # The new more flexible SetServersEx method
10 array
.append(["1.2.3.5"])
11 array
.append(["1.2.3.4#664", "foobar.com"])
12 array
.append(["1003:1234:abcd::1%eth0", "eng.mycorp.com", "lab.mycorp.com"])
13 print l
.SetServersEx(array
)
15 # Must create a new object for dnsmasq as the introspection gives the wrong
16 # signature for SetServers (av) while the code only expects a bunch of arguments
17 # instead of an array of variants
18 p
= bus
.get_object("uk.org.thekelleys.dnsmasq", "/uk/org/thekelleys/dnsmasq", introspect
=False)
19 l
= dbus
.Interface(p
, dbus_interface
="uk.org.thekelleys.dnsmasq")
21 # The previous method; all addresses in machine byte order
22 print l
.SetServers(dbus
.UInt32(16909060), # 1.2.3.5
23 dbus
.UInt32(16909061), # 1.2.3.4
25 dbus
.Byte(0x10), # 1003:1234:abcd::1