def setup_dbus(force=True): """ Initialize DBus. """ global bus, daemon, wireless, wired try: dbusmanager.connect_to_dbus() except DBusException: print >> sys.stderr, \ _("Can't connect to the daemon, trying to start it automatically...") try: bus = dbusmanager.get_bus() dbus_ifaces = dbusmanager.get_dbus_ifaces() daemon = dbus_ifaces['daemon'] wireless = dbus_ifaces['wireless'] wired = dbus_ifaces['wired'] except DBusException: print >> sys.stderr, \ _("Can't automatically start the daemon, this error is fatal...") if not daemon: print 'Error connecting to wicd via D-Bus. ' \ 'Please make sure the wicd service is running.' sys.exit(3) netentry_curses.dbus_init(dbus_ifaces) return True
def setup_dbus(force=True): global bus, daemon, wireless, wired try: dbusmanager.connect_to_dbus() except DBusException: print >> sys.stderr, language['cannot_connect_to_daemon'] bus = dbusmanager.get_bus() dbus_ifaces = dbusmanager.get_dbus_ifaces() daemon = dbus_ifaces['daemon'] wireless = dbus_ifaces['wireless'] wired = dbus_ifaces['wired'] netentry_curses.dbus_init(dbus_ifaces) return True