Hallo zusammen
Das Plugin "Bonjour" ist nun im CVS!
Bonjour stellt (wie das appel-pendant) alle (registrierten) Netzwerkdienste einer Dreambox über den avahi-daemon ins Netzwerk.
Da erlaubt es z.B. WebInterface zu finden ohne ein Bookmark zu haben.
Für mehr Details siehe : http://de.wikipedia.org/wiki/Zeroconf
Plugins welche Netwerkdienste zur Verfügung stellen können sich über dieses Plugin sehr einfach beim avahi "registrieren".
Beispiel aus dem Webinterface:
Registrierung eines AVAHI-Dienstes:
Python
registerBonjourService('http', config.plugins.Webinterface.http.port.value)
def registerBonjourService(protocol, port):
try:
from Plugins.Extensions.Bonjour.Bonjour import bonjour
service = bonjour.buildService(protocol, port)
bonjour.registerService(service, True)
print "[WebInterface.registerBonjourService] Service for protocol '%s' with port '%i' registered!" %(protocol, port)
return True
except ImportError, e:
print "[WebInterface.registerBonjourService] %s" %e
return False
Alles anzeigen
Deregistrierung eines AVAHI-Dienstes:
Python
def unregisterBonjourService(protocol):
try:
from Plugins.Extensions.Bonjour.Bonjour import bonjour
bonjour.unregisterService(protocol)
print "[WebInterface.unregisterBonjourService] Service for protocol '%s' unregistered!" %(protocol)
return True
except ImportError, e:
print "[WebInterface.unregisterBonjourService] %s" %e
return False
Alles anzeigen
Den Rest übernimmt dann das plugin (und natürlich avahi-daemon).