Changeset 3618

Show
Ignore:
Timestamp:
12/10/08 21:00:14 (3 months ago)
Author:
dmeyer
Message:

better hal/dbus error handling

Location:
trunk/beacon/src/server
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/beacon/src/server/devices.py

    r3612 r3618  
    4848try: 
    4949    import hal 
     50except ImportError, e: 
     51    log.error(e) 
     52    log.error('HAL support disabled') 
     53    hal = None 
     54try: 
     55    import cdrom 
    5056except ImportError: 
    51     log.error('hal support disabled') 
    52     hal = None 
    53     try: 
    54         import cdrom 
    55     except ImportError: 
    56         log.error('cdrom support disabled') 
    57         cdrom = None 
     57    log.error('Cdrom support disabled') 
     58    cdrom = None 
    5859 
    5960class HardwareMonitor(object): 
  • trunk/beacon/src/server/hal.py

    r3608 r3618  
    164164 
    165165_bus = None 
    166 _connection_timeout = 5 
    167166 
    168167@kaa.threaded(kaa.GOBJECT) 
    169168def start(): 
    170169    """ 
    171     Connect to DBUS and start to connect to hal. 
     170    Connect to D-Bus and start to connect to hal. 
    172171    """ 
    173172    global _bus 
    174     global _connection_timeout 
    175     _connection_timeout -= 1 
    176173    try: 
    177174        if not _bus: 
     
    179176    except Exception, e: 
    180177        # unable to connect to dbus 
    181         if not _connection_timeout: 
    182             # give up 
    183             emit_signal('failed', 'unable to connect to dbus') 
    184             return False 
    185         kaa.OneShotTimer(start).start(2) 
     178        emit_signal('failed', 'Unable to connect to D-Bus') 
    186179        return False 
    187180    try: 
     
    189182    except Exception, e: 
    190183        # unable to connect to hal 
    191         emit_signal('failed', 'hal not found on dbus') 
     184        emit_signal('failed', 'HAL not found on D-Bus') 
    192185        return False 
    193186    hal = dbus.Interface(obj, HAL + '.Manager')