[avahi] Python binding? (was: Automatically do something, when a service has been published?)

Trent Lloyd lathiat at bur.st
Sun Aug 24 14:17:21 PDT 2008


Hi Michael,

On 24/08/2008, at 10:02 PM, Michael Schmarck wrote:

> Hi.
>
> 2008/8/24 Trent Lloyd <lathiat at bur.st>:
>> Hi Michael,
>>
>> On 24/08/2008, at 7:00 PM, Michael Schmarck wrote:
>>
>>> Hi.
>>>
>>> 2008/8/23 Trent Lloyd <lathiat at bur.st>
>>>
>>>> Avahi doesn't support anything like this right now (some kind of
>>>> 'callout' based script for services appearing/disappearing)
>>>
>>> Too bad.
>>>
>>> By chance - does mDNSresponder support that?
>>
>> Not AFAIK, both mDNSResponder and Avahi are generally designed to be
>> integrated into programs rather than calling out to.
>>
>> Writing such a tool wouldn't be so hard, if you want to get your  
>> hands
>> a little dirty...
>
> Hm. Are there Python bindings available for Avahi (no, I haven't
> yet looked)?

Perhaps you should look ;)

It is not so much a 'binding'... as python-dbus makes a fairly nice  
API for us with introspection and we made a module with a couple extra  
convenience functions and constants.

http://www.avahi.org/browser/avahi-python/avahi
Unfortunately we re-wrote most tools in C around 0.5.2 but if you go  
back to 0.5 you can find most tools in python, but we since introduced  
'flags' paramater to many calls so they need a quick fix to work:

http://www.avahi.org/browser/avahi-python/avahi-publish-address.in?rev=ced0d86acf70f435ffdadb794db891be63a5b82a
http://www.avahi.org/browser/avahi-python/avahi-publish-service.in?rev=ced0d86acf70f435ffdadb794db891be63a5b82a

Regards,
Trent


More information about the avahi mailing list