コード例 #1
0
    def handle(self):
        print "Thread3 started\n"

        while 1:
            try:
                stringToSend = "<temp>" + str(sh.temperatureGet()) + "</temp>\n"
                self.request.sendall(stringToSend)
                stringToSend = "<alarm>" + str(sh.readTheAlarm()) + "</alarm>\n"
                self.request.sendall(stringToSend)
            except socket.error, msg:
                self.request.close()
                break
            time.sleep(1)
コード例 #2
0
 def testTemperatureGet(self):
     self.assertEqual(0,sm.temperatureGet())