[jhbuild] execute on systems without python-dbus as well



commit 1b0877f5c13a0eed98beb24ed23578dea16102bb
Author: Sven Herzberg <sven herzberg lanedo com>
Date:   Mon Oct 18 11:13:07 2010 +0200

    execute on systems without python-dbus as well
    
    * jhbuild/utils/trayicon.py: some systems (e.g. lots of scratchbox setups)
      don't have many python bindings available/installed. This commit makes
      jhbuild work in such environments as well

 jhbuild/utils/trayicon.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/jhbuild/utils/trayicon.py b/jhbuild/utils/trayicon.py
index 7ebad90..d33f097 100644
--- a/jhbuild/utils/trayicon.py
+++ b/jhbuild/utils/trayicon.py
@@ -21,12 +21,17 @@ import sys
 import os
 import subprocess
 import signal
-import dbus
+try:
+    import dbus
+except ImportError:
+    dbus = None
 
 class TrayIcon:
     proc = None
 
     def __init__(self, config):
+        if dbus is None:
+            return
         if config and config.notrayicon:
             return
         if not os.environ.get('DISPLAY'):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]