From 17a87e365175dac3682735710522695b7e5a6bdc Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 12 Dec 2008 20:25:23 +0100 Subject: avahi-discover crashes if row is unselected Quoting james_w: "I believe the cause of this was the a row was unselected, meaning that get_selection() returned None for iter, which then was used improperly in treemodel.get() The attached patch should prevent this from happening. Please consider applying it." Patch from james_w. Closes #226. --- avahi-python/avahi-discover/avahi-discover.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'avahi-python') diff --git a/avahi-python/avahi-discover/avahi-discover.in b/avahi-python/avahi-discover/avahi-discover.in index 229c7bd..be8c08b 100755 --- a/avahi-python/avahi-discover/avahi-discover.in +++ b/avahi-python/avahi-discover/avahi-discover.in @@ -61,7 +61,9 @@ class Main_window(SimpleGladeApp): def on_tree_view_cursor_changed(self, widget, *args): (model, iter) = widget.get_selection().get_selected() - (name,interface,protocol,stype,domain) = self.treemodel.get(iter,1,2,3,4,5) + stype = None + if iter is not None: + (name,interface,protocol,stype,domain) = self.treemodel.get(iter,1,2,3,4,5) if stype == None: self.info_label.set_markup("No service currently selected.") return -- cgit From 89c54c16f125331697298428e41ff1fd69afa23c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 12 Dec 2008 20:31:42 +0100 Subject: Install avahi bookmarks, even if no pygtk is available. Original patch by Stanislav Brabec. Re #222 --- avahi-python/Makefile.am | 2 -- avahi-python/avahi-bookmarks.in | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'avahi-python') diff --git a/avahi-python/Makefile.am b/avahi-python/Makefile.am index 09ad6de..4989b4b 100644 --- a/avahi-python/Makefile.am +++ b/avahi-python/Makefile.am @@ -29,7 +29,6 @@ SUBDIRS=avahi avahi-discover if HAVE_PYTHON if HAVE_PYTHON_DBUS -if HAVE_PYGTK pythonscripts = \ avahi-bookmarks @@ -43,4 +42,3 @@ CLEANFILES = $(pythonscripts) endif endif -endif diff --git a/avahi-python/avahi-bookmarks.in b/avahi-python/avahi-bookmarks.in index a1e8d0c..172abb3 100755 --- a/avahi-python/avahi-bookmarks.in +++ b/avahi-python/avahi-bookmarks.in @@ -24,7 +24,7 @@ import sys, getopt, os try: import avahi, gobject, dbus except ImportError: - print "Sorry, to use this tool you need to install Avahi, pygtk and python-dbus." + print "Sorry, to use this tool you need to install Avahi and python-dbus." sys.exit(1) try: -- cgit From 7289ee4063da05f276bce22685312baa83f0f117 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 12 Dec 2008 20:36:45 +0100 Subject: compile python module even without gtk. It seems, that most parts of python are not dependent on gtk+ Original patch from Stanislav Brabec. Closes #222. --- avahi-python/avahi/Makefile.am | 2 -- 1 file changed, 2 deletions(-) (limited to 'avahi-python') diff --git a/avahi-python/avahi/Makefile.am b/avahi-python/avahi/Makefile.am index 4a73022..c0c9c34 100644 --- a/avahi-python/avahi/Makefile.am +++ b/avahi-python/avahi/Makefile.am @@ -52,12 +52,10 @@ endif avahi_PYTHON = $(avahi_SCRIPTS) -if HAVE_PYGTK if HAVE_PYTHON_DBUS avahi_PYTHON += __init__.py -endif endif endif -- cgit From 4e0e2fd598d2d155a55e58b024de5b58592bec0e Mon Sep 17 00:00:00 2001 From: Takao Fujiwara Date: Sun, 7 Sep 2008 15:54:20 +1000 Subject: Add localization support to avahi-ui and avahi-discover Closes #122 Signed-off-by: Ted Percival Signed-off-by: Lennart Poettering --- avahi-python/avahi-discover/Makefile.am | 8 ++++++-- avahi-python/avahi-discover/avahi-discover.desktop.in | 12 ------------ avahi-python/avahi-discover/avahi-discover.desktop.in.in | 12 ++++++++++++ avahi-python/avahi-discover/avahi-discover.in | 5 ++++- 4 files changed, 22 insertions(+), 15 deletions(-) delete mode 100644 avahi-python/avahi-discover/avahi-discover.desktop.in create mode 100644 avahi-python/avahi-discover/avahi-discover.desktop.in.in (limited to 'avahi-python') diff --git a/avahi-python/avahi-discover/Makefile.am b/avahi-python/avahi-discover/Makefile.am index c1d6cab..e9c5583 100644 --- a/avahi-python/avahi-discover/Makefile.am +++ b/avahi-python/avahi-discover/Makefile.am @@ -23,7 +23,7 @@ EXTRA_DIST = \ __init__.py \ SimpleGladeApp.py \ avahi-discover.in \ - avahi-discover.desktop.in + avahi-discover.desktop.in.in if HAVE_PYTHON if HAVE_PYTHON_DBUS @@ -41,6 +41,7 @@ if HAVE_GDBM pythonscripts += \ avahi-discover desktop_DATA += avahi-discover.desktop +@INTLTOOL_DESKTOP_RULE@ avahi_discover_PYTHON += __init__.py SimpleGladeApp.py endif @@ -48,14 +49,17 @@ if HAVE_DBM pythonscripts += \ avahi-discover desktop_DATA += avahi-discover.desktop +@INTLTOOL_DESKTOP_RULE@ avahi_discover_PYTHON += __init__.py SimpleGladeApp.py endif -avahi-discover.desktop: avahi-discover.desktop.in +avahi-discover.desktop.in: avahi-discover.desktop.in.in sed -e 's,@bindir\@,$(bindir),g' $< > $@ avahi-discover: avahi-discover.in sed -e 's,@PYTHON\@,$(PYTHON),g' \ + -e 's,@GETTEXT_PACKAGE\@,"$(GETTEXT_PACKAGE)",g' \ + -e 's,@LOCALEDIR\@,"$(datadir)/locale",g' \ -e 's,@interfacesdir\@,$(interfacesdir),g' $< > $@ chmod +x $@ diff --git a/avahi-python/avahi-discover/avahi-discover.desktop.in b/avahi-python/avahi-discover/avahi-discover.desktop.in deleted file mode 100644 index e896192..0000000 --- a/avahi-python/avahi-discover/avahi-discover.desktop.in +++ /dev/null @@ -1,12 +0,0 @@ -[Desktop Entry] -Version=1.0 -Encoding=UTF-8 -Name=Avahi Zeroconf Browser -Comment=Browse for Zeroconf services available on your network -Exec=@bindir@/avahi-discover -Terminal=false -Type=Application -Icon=network-wired -Categories=GNOME;Application;System; -StartupNotify=false -GenericName= diff --git a/avahi-python/avahi-discover/avahi-discover.desktop.in.in b/avahi-python/avahi-discover/avahi-discover.desktop.in.in new file mode 100644 index 0000000..031024c --- /dev/null +++ b/avahi-python/avahi-discover/avahi-discover.desktop.in.in @@ -0,0 +1,12 @@ +[Desktop Entry] +Version=1.0 +Encoding=UTF-8 +_Name=Avahi Zeroconf Browser +_Comment=Browse for Zeroconf services available on your network +Exec=@bindir@/avahi-discover +Terminal=false +Type=Application +Icon=network-wired +Categories=GNOME;Application;System; +StartupNotify=false +GenericName= diff --git a/avahi-python/avahi-discover/avahi-discover.in b/avahi-python/avahi-discover/avahi-discover.in index be8c08b..0558424 100755 --- a/avahi-python/avahi-discover/avahi-discover.in +++ b/avahi-python/avahi-discover/avahi-discover.in @@ -22,8 +22,11 @@ import os, sys try: - import avahi, gtk, gobject, dbus, avahi.ServiceTypeDatabase + import avahi, gettext, gtk, gobject, dbus, avahi.ServiceTypeDatabase from avahi_discover.SimpleGladeApp import SimpleGladeApp + gtk.glade.bindtextdomain(@GETTEXT_PACKAGE@, @LOCALEDIR@) + gtk.glade.textdomain(@GETTEXT_PACKAGE@) + _ = gettext.gettext except ImportError, e: print "Sorry, to use this tool you need to install Avahi, pygtk and python-dbus.\n Error: %s" % e sys.exit(1) -- cgit From 25026cec9f1910c437b2a0a22c0f100bfb021ef0 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 12 Dec 2008 22:10:47 +0100 Subject: make make distclean pass --- avahi-python/avahi-discover/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'avahi-python') diff --git a/avahi-python/avahi-discover/Makefile.am b/avahi-python/avahi-discover/Makefile.am index e9c5583..a44a071 100644 --- a/avahi-python/avahi-discover/Makefile.am +++ b/avahi-python/avahi-discover/Makefile.am @@ -64,7 +64,8 @@ avahi-discover: avahi-discover.in chmod +x $@ bin_SCRIPTS = $(pythonscripts) -CLEANFILES = $(pythonscripts) $(desktop_DATA) *.pyc *.pyo + +CLEANFILES = $(pythonscripts) $(desktop_DATA) *.pyc *.pyo avahi-discover.desktop.in endif endif -- cgit