changeset 83:ae2ed47a5321

io can now return to being dummy (untested) io can now return to being dummy (untested) fixed a wrong method name in SerialPots too
author drewp
date Fri, 12 Jul 2002 10:59:43 +0000
parents 65e77dc74ad8
children 09b3bf8a9201
files light8/io.py
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/light8/io.py	Fri Jul 12 10:45:05 2002 +0000
+++ b/light8/io.py	Fri Jul 12 10:59:43 2002 +0000
@@ -12,6 +12,11 @@
         # you'd override with additional startup stuff here,
         # perhaps even loading a module and saving it to a class
         # attr so the subclass-specific functions can use it
+
+    def godummy(self):
+        print "IO: %s is going dummy" % self.__name__
+        self.dummy=1
+        # you might override this to close ports, etc
         
     def isdummy(self):
         return self.dummy
@@ -58,7 +63,7 @@
         self.dummy=1
         self.__name__='SerialPots' # i thought this was automatic!
 
-    def startup(self):
+    def golive(self):
         """
         ls -l /dev/i2c-0
         crw-rw-rw-    1 root     root      89,   0 Jul 11 12:27 /dev/i2c-0
@@ -74,6 +79,10 @@
         ioctl(self.f,I2C_SLAVE,port)
         self.dummy=0
 
+    def godummy(self):
+        BaseIO.godummy(self)
+        self.f.close()
+
     def getlevels(self):
         if self.dummy:
             return (0,0,0,0)