annotate DataTypes/dmxlevel.py @ 15:c76b62eccdec
put **kw back in, they now go to the scale and can override the defaults.
put **kw back in, they now go to the scale and can override the defaults.
for our purposes, we probably want to edit the defaults so we don't have
them in every call.
author |
dmcc |
date |
Sun, 07 Jul 2002 06:18:40 +0000 |
parents |
45b12307c695 |
children |
|
rev |
line source |
0
|
1 ###
|
|
2
|
|
3 """
|
|
4 Snippet 0x93.2b: example of outputting a special type
|
|
5
|
|
6 class DMXLevel(float):
|
|
7 def __init__(self,f):
|
|
8 self.value = min(max(0,f),255)
|
|
9 ...
|
|
10 def __get__(...) # maybe
|
|
11
|
|
12 output.dmxlevel = DMXLevel(300)
|
|
13
|
|
14 >>> print output.dmxlevel
|
|
15 255
|
|
16
|
|
17 dmxlevel = DMXLevel(3)
|
|
18 dmxlevel += 800
|
|
19 d = d + 800
|
|
20
|
|
21 There's yer problem:
|
|
22 http://python.org/doc/current/ref/numeric-types.html#l2h-152
|
|
23
|
|
24 """
|