Here are the examples of the python api twisted.web.server.EntryGroupNew taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
0
Example 1
def publish(self):
text_ap = ["deviceid=" + self.info.deviceid, "features=" + hex(self.info.features), "model=" + self.info.model]
text_at = ["tp=UDP", "sm=false", "sv=false", "ek=1", "et=0,1", "cn=0,1", "ch=2", "ss=16", "sr=44100", "pw=false", "vn=3", "txtvers=1"]
bus = dbus.SystemBus()
server = dbus.Interface(bus.get_object(avahi.DBUS_NAME, avahi.DBUS_PATH_SERVER), avahi.DBUS_INTERFACE_SERVER)
self.group = dbus.Interface(bus.get_object(avahi.DBUS_NAME, server.EntryGroupNew()), avahi.DBUS_INTERFACE_ENTRY_GROUP)
self.group.AddService(
avahi.IF_UNSPEC,
avahi.PROTO_UNSPEC,
dbus.UInt32(0),
AIRPLAY_BANNER + platform.node(),
"_airplay._tcp",
"",
"",
dbus.UInt16(AIRPLAY_PORT),
avahi.string_array_to_txt_array(text_ap)
)
self.group.AddService(
avahi.IF_UNSPEC,
avahi.PROTO_UNSPEC,
dbus.UInt32(0),
self.info.deviceid + "@" + AIRPLAY_BANNER + platform.node(),
"_raop._tcp",
"",
"",
dbus.UInt16(AIRTUNES_PORT),
avahi.string_array_to_txt_array(text_at)
)
self.group.Commit()