[avahi] pygtk

Lennart Poettering lennart at poettering.de
Fri Aug 5 00:18:11 EST 2005


On Thu, 04.08.05 15:45, Sebastien Estienne (sebastien.estienne at gmail.com) wrote:

> > AM_PATH_PYTHON(2.4)
> > AM_PYTHON_CHECK_VERSION("$PYTHON", 2.4, [HAVE_PYTHON=yes], [HAVE_PYTHON=no])
> > AM_CONDITIONAL(HAVE_PYTHON, [test "x$HAVE_PYTHON" = xyes ])
> > 
> 
> I replaced it because this:
> AM_PATH_PYTHON(2.4, [HAVE_PYTHON=yes], [HAVE_PYTHON=no])
> didn't work on my pc, HAVE_PYTHON wasn't define, (no "yes or no" in
> the summary)

Please update to automake1.9. (maybe 1.8 suffices, though. 1.7
definitely isn't enough)

> > try:
> >        import gtk, gobject
> > except ImportError, e:
> >        print "Sorry, you need to install pygtk to use this tool."
> >        sys.exit(2)
> > 

> Oki i'll follow your advice, but i see a little problem with doing this:
> what happen if the user starts avahi-discover from his "applications"
> menu? he can't know what is wrong.

Hmm, good point. I personally never use that menu, so I didn't think
of it. Perhaps we should leave it to the distributors to add a
pygtk dependency (or "Recommends:" line) to their packages.

> > BTW, I have another suggestion for you how to improve
> > avahi-discover. Add another tree level for the network a service is
> > found on, and drop the column showing this instead. An example:
> > 
> > + Interface eth0 (IPv4)
> >   + Domain .local
> >     + Service Type _http._tcp
> >       + Web Service #1
> >       + Blah Blubb
> >     + Type _ftp._tcp
> >       + My FTP Server
> >   + Domain .home
> >     + Service Type _presence._tcp
> >       + Lieschen Müller
> >       + Peter Panther
> > + Interface wlan0 (IPv4)
> >   + Domain .local
> >     + Service Type _http._tcp
> >       + Miau
> > + Interface wlan0 (IPv6)
> >   + Domain .local
> >     + Service Type _gurki._tcp
> >       + Brrrumm!
> > 
> > And expanding the entries in the tree view by default would be cool,
> > too.

> Oki, how can i make the link between the interface number and it's real name
> eg 8 -> eth0 ?

In C it is simple. just use the SIOCGIFNAME ioctl on any socket. (see
netdevice(7) for more info)

In python its probably a little more difficult.

Google found this for me:

http://twistedmatrix.com/wiki/python/IfConfig

I could add a small helper function to the DBUS API to facilitate
this, though it's probably not the cleanest thing to do. 

> > And finally: clicking on any of the entries doesn't reveal any
> > information at the moment. This worked some revisions ago, but doesn't any more?
> > 
> I modified avahi-discover.glade to add a signal, it probably means
> that it's not pointing to the modified glade file (probably the old
> one)

Yes, you right. Thanks for the pointer!

Lennart

-- 
Lennart Poettering; lennart [at] poettering [dot] de
ICQ# 11060553; GPG 0x1A015CC4; http://0pointer.de/lennart/


More information about the avahi mailing list