From 687d932065bc3b95cac0a948a1cbf87fd21d0ac7 Mon Sep 17 00:00:00 2001 From: imdano <> Date: Sat, 6 Sep 2008 19:53:25 +0000 Subject: [PATCH] experimental: - Fix some syntax/import problems created during the merge --- wicd/gui.py | 11 +---------- wicd/prefs.py | 11 +++++++++-- wicd/wicd-daemon.py | 4 +++- wicd/wpath.py | 15 ++++++++++----- 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/wicd/gui.py b/wicd/gui.py index 26e3801..f492b3c 100644 --- a/wicd/gui.py +++ b/wicd/gui.py @@ -38,8 +38,8 @@ from wicd import misc from wicd import wpath from wicd.misc import noneToString from wicd.netentry import WiredNetworkEntry, WirelessNetworkEntry -from wicd.prefs import PreferencesDialog from wicd.dbusmanager import DBusManager +from wicd.prefs import PreferencesDialog if __name__ == '__main__': wpath.chdir(__file__) @@ -84,7 +84,6 @@ def setup_dbus(dbus_man=None): wired = dbus_ifaces['wired'] return True - def error(parent, message): """ Shows an error dialog """ dialog = gtk.MessageDialog(parent, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, @@ -92,14 +91,6 @@ def error(parent, message): dialog.set_markup(message) dialog.run() dialog.destroy() - -def alert(parent, message): - """ Shows an error dialog """ - dialog = gtk.MessageDialog(parent, gtk.DIALOG_MODAL, gtk.MESSAGE_WARNING, - gtk.BUTTONS_OK) - dialog.set_markup(message) - dialog.run() - dialog.destroy() ######################################## ##### GTK EXTENSION CLASSES diff --git a/wicd/prefs.py b/wicd/prefs.py index 57834ec..830337d 100644 --- a/wicd/prefs.py +++ b/wicd/prefs.py @@ -28,7 +28,6 @@ import gobject import pango from wicd import misc -from wicd import gui from wicd.misc import checkboxTextboxToggle, noneToBlankString daemon = None @@ -37,6 +36,14 @@ wired = None language = misc.get_language_list_gui() +def alert(parent, message): + """ Shows an alert dialog """ + dialog = gtk.MessageDialog(parent, gtk.DIALOG_MODAL, gtk.MESSAGE_WARNING, + gtk.BUTTONS_OK) + dialog.set_markup(message) + dialog.run() + dialog.destroy() + class PreferencesDialog(object): def __init__(self, wTree, dbus): global daemon, wireless, wired @@ -229,7 +236,7 @@ class PreferencesDialog(object): wired.SetWiredAutoConnectMethod(1) if self.backends[self.backendcombo.get_active()] != daemon.GetSavedBackend(): - gui.alert(self.dialog, language["backend_alert"]) + alert(self.dialog, language["backend_alert"]) daemon.SetBackend(self.backends[self.backendcombo.get_active()]) # External Programs Tab diff --git a/wicd/wicd-daemon.py b/wicd/wicd-daemon.py index 58e585e..72871f4 100644 --- a/wicd/wicd-daemon.py +++ b/wicd/wicd-daemon.py @@ -63,6 +63,8 @@ if __name__ == '__main__': misc.RenameProcess("wicd") +wireless_conf = wpath.etc + "wireless-settings.conf" +wired_conf = wpath.etc + "wired-settings.conf" class WicdDaemon(dbus.service.Object): def __init__(self, bus_name, object_path="/org/wicd/daemon", @@ -1414,7 +1416,7 @@ def main(argv): # Open the DBUS session bus = dbus.SystemBus() wicd_bus = dbus.service.BusName('org.wicd.daemon', bus=bus) - daemon = WicdDaemon(wicd_bus, auto_connect=auto_scan) + daemon = WicdDaemon(wicd_bus, auto_connect=auto_connect) gobject.threads_init() if not no_poll: diff --git a/wicd/wpath.py b/wicd/wpath.py index d519a50..3ce2d6b 100644 --- a/wicd/wpath.py +++ b/wicd/wpath.py @@ -15,8 +15,9 @@ current = os.path.dirname(os.path.realpath(__file__)) + '/' # These paths are replaced when setup.py configure is run -# All of these paths *MUST* end in a / -# except the python one, of course as it is an executable +# All directory paths *MUST* end in a / + +# DIRECTORIES lib = '/usr/lib/wicd/' share = '/usr/share/wicd/' @@ -26,14 +27,12 @@ encryption = '/etc/wicd/encryption/templates/' bin = '/usr/bin/' networks = '/var/lib/wicd/configurations/' log = '/var/log/wicd/' -backends = '/usr/lib/wicd/backends/' - -# other, less useful entries resume = '/etc/acpi/resume.d/' suspend = '/etc/acpi/suspend.d/' sbin = '/usr/sbin/' dbus = '/etc/dbus-1/system.d/' desktop = '/usr/share/applications/' +backends= '/usr/lib/wicd/backends/' translations = '/usr/share/locale/' icons = '/usr/share/icons/hicolor/' autostart = '/etc/xdg/autostart/' @@ -42,6 +41,9 @@ docdir = '/usr/share/doc/wicd/' mandir = '/usr/share/man/' kdedir = '/usr/share/autostart/' +# FILES + +# python begins the file section python = '/usr/bin/python' pidfile = '/var/run/wicd/wicd.pid' # stores something like other/wicd @@ -49,6 +51,9 @@ pidfile = '/var/run/wicd/wicd.pid' initfile = 'init/debian/wicd' # stores only the file name, i.e. wicd initfilename = 'wicd' + +# BOOLEANS + no_install_init = False no_install_man = False no_install_kde = False