diff Control.py @ 12:9d5b291cfd01

Add/correct docstrings & comments.
author darius
date Sat, 29 Sep 2007 14:51:20 +0000
parents 483375ca5d10
children f1832dec26e3
line wrap: on
line diff
--- a/Control.py	Sat Sep 29 14:40:54 2007 +0000
+++ b/Control.py	Sat Sep 29 14:51:20 2007 +0000
@@ -3,7 +3,7 @@
 ############################################################################
 # Control class for beermon
 #
-# $Id: Control.py,v 1.1 2007/09/29 14:39:59 darius Exp $
+# $Id: Control.py,v 1.2 2007/09/29 14:51:20 darius Exp $
 #
 # Depends on: Python 2.3 (I think)
 #
@@ -51,7 +51,7 @@
     staleDataTime = 30
     
     def __init__(self, _log, m, conf):
-        """m is a MonitorDev object, conf is a ConfigParser object"""
+        """m is a MonitorDev object, _log is a logging object, conf is a ConfigParser object"""
         global log
         log = _log
 
@@ -65,6 +65,9 @@
         log.debug("hysteresis - %3.2f" % (self.hysteresis))
         log.debug("pollInterval - %d" % (self.pollInterval))
 
+        # We sleep on this, using time.sleep() doesn't work well in a
+        # threaded environment (eg ctrl-c will be blocked until the
+        # timeout expires.)
         self.cv = threading.Condition()
         self.cv.acquire()
         
@@ -73,7 +76,7 @@
         log.debug("=== Starting ===")
         log.debug("Fermenter	Fridge	Ambient	State	New State")
         while True:
-            # Check if our monitor thread has died
+            # Check if the monitor thread has died
             if (not self.m.isAlive()):
                 raise ThreadDied, "Monitor thread has died"