diff options
-rwxr-xr-x | avahi-utils/avahi-bookmarks.in | 21 | ||||
-rwxr-xr-x | avahi-utils/avahi-discover.in | 13 | ||||
-rwxr-xr-x | avahi-utils/avahi-dump-all.in | 8 | ||||
-rwxr-xr-x | avahi-utils/avahi-publish-address.in | 8 | ||||
-rwxr-xr-x | avahi-utils/avahi-publish-service.in | 8 |
5 files changed, 43 insertions, 15 deletions
diff --git a/avahi-utils/avahi-bookmarks.in b/avahi-utils/avahi-bookmarks.in index 7504349..72f8e44 100755 --- a/avahi-utils/avahi-bookmarks.in +++ b/avahi-utils/avahi-bookmarks.in @@ -19,18 +19,27 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA. -import avahi, dbus, gobject, sys +import sys -from twisted.internet import gtk2reactor -gtk2reactor.install() -from twisted.internet import reactor -from twisted.web import server, resource +try: + import avahi, gobject, dbus +except ImportError: + print "Sorry, to use this tool you need to install Avahi, pygtk and python-dbus." + sys.exit(1) try: import dbus.glib -except ImportError, e: +except ImportError: pass +try: + from twisted.internet import gtk2reactor + gtk2reactor.install() + from twisted.internet import reactor + from twisted.web import server, resource +except ImportError: + print "Sorry, to use this tool you need to install twisted." + sys.exit(1) class AvahiBookmarks(resource.Resource): isLeaf = True diff --git a/avahi-utils/avahi-discover.in b/avahi-utils/avahi-discover.in index fc1b476..6c78c51 100755 --- a/avahi-utils/avahi-discover.in +++ b/avahi-utils/avahi-discover.in @@ -19,12 +19,14 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA. -import os -import gtk -import gobject +import os, sys -import avahi, dbus, gobject, sys -from avahi.SimpleGladeApp import SimpleGladeApp +try: + import avahi, gtk, gobject, dbus + from avahi.SimpleGladeApp import SimpleGladeApp +except ImportError: + print "Sorry, to use this tool you need to install Avahi, pygtk and python-dbus." + sys.exit(1) try: import dbus.glib @@ -34,7 +36,6 @@ except ImportError, e: service_type_browsers = {} service_browsers = {} - glade_dir = "@interfacesdir@" class Main_window(SimpleGladeApp): diff --git a/avahi-utils/avahi-dump-all.in b/avahi-utils/avahi-dump-all.in index c3c56b7..c90e964 100755 --- a/avahi-utils/avahi-dump-all.in +++ b/avahi-utils/avahi-dump-all.in @@ -19,7 +19,13 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA. -import avahi, dbus, gobject, sys +import sys + +try: + import avahi, gobject, dbus +except ImportError: + print "Sorry, to use this tool you need to install Avahi, pygtk and python-dbus." + sys.exit(1) try: import dbus.glib diff --git a/avahi-utils/avahi-publish-address.in b/avahi-utils/avahi-publish-address.in index 1942a69..2806049 100755 --- a/avahi-utils/avahi-publish-address.in +++ b/avahi-utils/avahi-publish-address.in @@ -19,7 +19,13 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA. -import avahi, dbus, gobject, sys, getopt, string +import sys, getopt, string + +try: + import avahi, gobject, dbus +except ImportError: + print "Sorry, to use this tool you need to install Avahi, pygtk and python-dbus." + sys.exit(1) try: import dbus.glib diff --git a/avahi-utils/avahi-publish-service.in b/avahi-utils/avahi-publish-service.in index de25957..89c1566 100755 --- a/avahi-utils/avahi-publish-service.in +++ b/avahi-utils/avahi-publish-service.in @@ -19,7 +19,13 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA. -import avahi, dbus, gobject, sys, getopt +import sys, getopt + +try: + import avahi, gobject, dbus +except ImportError: + print "Sorry, to use this tool you need to install Avahi, pygtk and python-dbus." + sys.exit(1) try: import dbus.glib |