def hal_failure(reason): print "HAL module start failed:", reason if cdrom: for sig in cdrom.signals: cdrom.signals[sig].connect(hal.signals[sig].emit) print "falling back to plain cdrom module" cdrom.start()
def hal_failure(reason): print 'HAL module start failed:', reason if cdrom: for sig in cdrom.signals: cdrom.signals[sig].connect(hal.signals[sig].emit) print 'falling back to plain cdrom module' cdrom.start()
from kaa.beacon.server.hwmon import hal signals = hal.signals print "Start HAL monitor" hal.start() except ImportError: print "HAL not found" hal = None try: from kaa.beacon.hwmon import cdrom if not hal: signals = cdrom.signals print "Start cdrom monitor" cdrom.start() except ImportError: cdrom = None def hal_failure(reason): print "HAL module start failed:", reason if cdrom: for sig in cdrom.signals: cdrom.signals[sig].connect(hal.signals[sig].emit) print "falling back to plain cdrom module" cdrom.start() if hal and cdrom: signals["failed"].connect(hal_failure)
try: from kaa.beacon.server.hwmon import hal signals = hal.signals print 'Start HAL monitor' hal.start() except ImportError: print 'HAL not found' hal = None try: from kaa.beacon.hwmon import cdrom if not hal: signals = cdrom.signals print 'Start cdrom monitor' cdrom.start() except ImportError: cdrom = None def hal_failure(reason): print 'HAL module start failed:', reason if cdrom: for sig in cdrom.signals: cdrom.signals[sig].connect(hal.signals[sig].emit) print 'falling back to plain cdrom module' cdrom.start() if hal and cdrom: signals['failed'].connect(hal_failure)