# 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
# 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
service_type_browsers = {}
service_browsers = {}
-
glade_dir = "@interfacesdir@"
class Main_window(SimpleGladeApp):
# 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
# 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
# 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