Ver Fonte

tried to throw an exception if the display is not available

Helmut Pozimski há 11 anos atrás
pai
commit
1fc29243d9
2 ficheiros alterados com 3 adições e 1 exclusões
  1. 1 1
      adafruit_7segment/Adafruit_I2C.py
  2. 2 0
      stdd

+ 1 - 1
adafruit_7segment/Adafruit_I2C.py

@@ -55,7 +55,7 @@ class Adafruit_I2C:
         return val
 
     def errMsg(self):
-        print "Error accessing 0x%02X: Check your I2C address" % self.address
+        raise Exception("cannot connect to device, check hardware address!")
         return -1
 
     def write8(self, reg, value):

+ 2 - 0
stdd

@@ -134,6 +134,8 @@ if options.daemon is True:
 		passwd.close()
 		group.close()
 		daemon.DropPriv(int(uid), int(gid))
+		logger.debug("dropped privileges, now running as " + options.user +
+			" and group" + options.group)
 
 """Initialize the display object"""
 display = SevenSegment(config.hw_address)