[gnome-applets/wip/dont-use-deprecated: 2/3] invest-applet: moved network manager version printout to proper place
- From: Enrico Minack <eminack src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets/wip/dont-use-deprecated: 2/3] invest-applet: moved network manager version printout to proper place
- Date: Sat, 7 May 2011 22:34:26 +0000 (UTC)
commit 1bd71f7bdf266b2b38bd43a5103464fba1d1c798
Author: Enrico Minack <enrico-minack gmx de>
Date: Sat May 7 10:33:29 2011 +0200
invest-applet: moved network manager version printout to proper place
invest-applet/invest/invest-applet.py | 3 ++-
invest-applet/invest/networkmanager.py | 6 +++++-
2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/invest-applet/invest/invest-applet.py b/invest-applet/invest/invest-applet.py
index 3c23748..9106c27 100755
--- a/invest-applet/invest/invest-applet.py
+++ b/invest-applet/invest/invest-applet.py
@@ -16,7 +16,7 @@ else:
sys.path.insert(0, abspath("@PYTHONDIR@"))
# Now the path is set, import our applet
-import invest, invest.applet, invest.defs, invest.help
+import invest, invest.applet, invest.defs, invest.help, invest.networkmanager
# Prepare i18n
import gettext, locale
@@ -70,6 +70,7 @@ if __name__ == "__main__":
# because that variable was set here to be True
invest.debug("Data Dir: %s" % invest.SHARED_DATA_DIR)
invest.debug("Detected PROXY: %s" % invest.PROXY)
+ invest.debug("Found NetworkManager spec %s (%s)" % (invest.networkmanager.spec, invest.networkmanager.version))
invest.debug("Starting applet factory, waiting for gnome-panel to connect ...")
PanelApplet.Applet.factory_main(
diff --git a/invest-applet/invest/networkmanager.py b/invest-applet/invest/networkmanager.py
index 58a52b2..34700ec 100644
--- a/invest-applet/invest/networkmanager.py
+++ b/invest-applet/invest/networkmanager.py
@@ -10,6 +10,10 @@ STATE_CONNECTING = dbus.UInt32(2)
STATE_CONNECTED = dbus.UInt32(3)
STATE_DISCONNEDTED = dbus.UInt32(4)
+# attributes of the network manager
+version = NETWORKMANAGER_VERSION
+spec = "0.8"
+
# numerical values of these states depend on the network manager version, they changed with 0.8.995
fields = NETWORKMANAGER_VERSION.split('.')
if len(fields) >= 2:
@@ -20,7 +24,7 @@ if len(fields) >= 2:
if major > 0 or major == 0 and (minor >= 9 or len(fields) > 2 and minor == 8 and micro >= 995):
# see http://projects.gnome.org/NetworkManager/developers/ -> spec 0.9 -> NM_STATE
- print("Found NetworkManager spec 0.9 (%s)" % NETWORKMANAGER_VERSION)
+ spec = "0.9"
STATE_UNKNOWN = dbus.UInt32(0)
STATE_ASLEEP = dbus.UInt32(10)
STATE_DISCONNECTED = dbus.UInt32(20)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]