Mercurial > code > home > repos > light9
annotate light8/io.py @ 59:001646cd5349
all mousewheel events everywhere will now pass up the tree to be caught by
all mousewheel events everywhere will now pass up the tree to be caught by
higher widgets. if things get slow, this might be the problem
author | drewp |
---|---|
date | Tue, 09 Jul 2002 07:36:29 +0000 |
parents | 032b2b67bc10 |
children | 177e9ba0b4a7 |
rev | line source |
---|---|
16 | 1 from parport import * |
0 | 2 |
29
f595fdd4c548
minor cleanups, convert parallel port controller to a class
dmcc
parents:
16
diff
changeset
|
3 class ParportDMX: |
f595fdd4c548
minor cleanups, convert parallel port controller to a class
dmcc
parents:
16
diff
changeset
|
4 def __init__(self, dummy=1, dimmers=68): |
53 | 5 self.dimmers = dimmers |
29
f595fdd4c548
minor cleanups, convert parallel port controller to a class
dmcc
parents:
16
diff
changeset
|
6 self.dummy = dummy |
f595fdd4c548
minor cleanups, convert parallel port controller to a class
dmcc
parents:
16
diff
changeset
|
7 if not dummy: |
f595fdd4c548
minor cleanups, convert parallel port controller to a class
dmcc
parents:
16
diff
changeset
|
8 getparport() |
f595fdd4c548
minor cleanups, convert parallel port controller to a class
dmcc
parents:
16
diff
changeset
|
9 def sendlevels(self, levels): |
f595fdd4c548
minor cleanups, convert parallel port controller to a class
dmcc
parents:
16
diff
changeset
|
10 if self.dummy: return |
f595fdd4c548
minor cleanups, convert parallel port controller to a class
dmcc
parents:
16
diff
changeset
|
11 levels = list(levels) + [0] |
f595fdd4c548
minor cleanups, convert parallel port controller to a class
dmcc
parents:
16
diff
changeset
|
12 # if levels[14] > 0: levels[14] = 100 # non-dim |
f595fdd4c548
minor cleanups, convert parallel port controller to a class
dmcc
parents:
16
diff
changeset
|
13 outstart() |
53 | 14 for p in range(1, self.dimmers + 2): |
29
f595fdd4c548
minor cleanups, convert parallel port controller to a class
dmcc
parents:
16
diff
changeset
|
15 outbyte(levels[p-1]*255 / 100) |