5
5
# the SWIG interface file instead.
6
6
7
7
from sys import version_info as _swig_python_version_info
8
+
8
9
if _swig_python_version_info < (2 , 7 , 0 ):
9
10
raise RuntimeError ("Python 2.7 or later required" )
10
11
19
20
except ImportError :
20
21
import __builtin__
21
22
23
+
22
24
def _swig_repr (self ):
23
25
try :
24
26
strthis = "proxy of " + self .this .__repr__ ()
25
27
except __builtin__ .Exception :
26
28
strthis = ""
27
- return "<%s.%s; %s >" % (self .__class__ .__module__ , self .__class__ .__name__ , strthis ,)
29
+ return "<%s.%s; %s >" % (
30
+ self .__class__ .__module__ ,
31
+ self .__class__ .__name__ ,
32
+ strthis ,
33
+ )
28
34
29
35
30
36
def _swig_setattr_nondynamic_instance_variable (set ):
@@ -37,6 +43,7 @@ def set_instance_attr(self, name, value):
37
43
set (self , name , value )
38
44
else :
39
45
raise AttributeError ("You cannot add instance attributes to %s" % self )
46
+
40
47
return set_instance_attr
41
48
42
49
@@ -46,18 +53,22 @@ def set_class_attr(cls, name, value):
46
53
set (cls , name , value )
47
54
else :
48
55
raise AttributeError ("You cannot add class attributes to %s" % cls )
56
+
49
57
return set_class_attr
50
58
51
59
52
60
def _swig_add_metaclass (metaclass ):
53
61
"""Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
62
+
54
63
def wrapper (cls ):
55
64
return metaclass (cls .__name__ , cls .__bases__ , cls .__dict__ .copy ())
65
+
56
66
return wrapper
57
67
58
68
59
69
class _SwigNonDynamicMeta (type ):
60
70
"""Meta class to enforce nondynamic attributes (no new attributes) for a class"""
71
+
61
72
__setattr__ = _swig_setattr_nondynamic_class_variable (type .__setattr__ )
62
73
63
74
@@ -78,42 +89,83 @@ class _SwigNonDynamicMeta(type):
78
89
WS2812_STRIP = _rpi_ws281x .WS2812_STRIP
79
90
SK6812_STRIP = _rpi_ws281x .SK6812_STRIP
80
91
SK6812W_STRIP = _rpi_ws281x .SK6812W_STRIP
92
+
93
+
81
94
class ws2811_channel_t (object ):
82
- thisown = property (lambda x : x .this .own (), lambda x , v : x .this .own (v ), doc = "The membership flag" )
95
+ thisown = property (
96
+ lambda x : x .this .own (), lambda x , v : x .this .own (v ), doc = "The membership flag"
97
+ )
83
98
__repr__ = _swig_repr
84
- gpionum = property (_rpi_ws281x .ws2811_channel_t_gpionum_get , _rpi_ws281x .ws2811_channel_t_gpionum_set )
85
- invert = property (_rpi_ws281x .ws2811_channel_t_invert_get , _rpi_ws281x .ws2811_channel_t_invert_set )
86
- count = property (_rpi_ws281x .ws2811_channel_t_count_get , _rpi_ws281x .ws2811_channel_t_count_set )
87
- strip_type = property (_rpi_ws281x .ws2811_channel_t_strip_type_get , _rpi_ws281x .ws2811_channel_t_strip_type_set )
88
- leds = property (_rpi_ws281x .ws2811_channel_t_leds_get , _rpi_ws281x .ws2811_channel_t_leds_set )
89
- brightness = property (_rpi_ws281x .ws2811_channel_t_brightness_get , _rpi_ws281x .ws2811_channel_t_brightness_set )
90
- wshift = property (_rpi_ws281x .ws2811_channel_t_wshift_get , _rpi_ws281x .ws2811_channel_t_wshift_set )
91
- rshift = property (_rpi_ws281x .ws2811_channel_t_rshift_get , _rpi_ws281x .ws2811_channel_t_rshift_set )
92
- gshift = property (_rpi_ws281x .ws2811_channel_t_gshift_get , _rpi_ws281x .ws2811_channel_t_gshift_set )
93
- bshift = property (_rpi_ws281x .ws2811_channel_t_bshift_get , _rpi_ws281x .ws2811_channel_t_bshift_set )
94
- gamma = property (_rpi_ws281x .ws2811_channel_t_gamma_get , _rpi_ws281x .ws2811_channel_t_gamma_set )
99
+ gpionum = property (
100
+ _rpi_ws281x .ws2811_channel_t_gpionum_get ,
101
+ _rpi_ws281x .ws2811_channel_t_gpionum_set ,
102
+ )
103
+ invert = property (
104
+ _rpi_ws281x .ws2811_channel_t_invert_get , _rpi_ws281x .ws2811_channel_t_invert_set
105
+ )
106
+ count = property (
107
+ _rpi_ws281x .ws2811_channel_t_count_get , _rpi_ws281x .ws2811_channel_t_count_set
108
+ )
109
+ strip_type = property (
110
+ _rpi_ws281x .ws2811_channel_t_strip_type_get ,
111
+ _rpi_ws281x .ws2811_channel_t_strip_type_set ,
112
+ )
113
+ leds = property (
114
+ _rpi_ws281x .ws2811_channel_t_leds_get , _rpi_ws281x .ws2811_channel_t_leds_set
115
+ )
116
+ brightness = property (
117
+ _rpi_ws281x .ws2811_channel_t_brightness_get ,
118
+ _rpi_ws281x .ws2811_channel_t_brightness_set ,
119
+ )
120
+ wshift = property (
121
+ _rpi_ws281x .ws2811_channel_t_wshift_get , _rpi_ws281x .ws2811_channel_t_wshift_set
122
+ )
123
+ rshift = property (
124
+ _rpi_ws281x .ws2811_channel_t_rshift_get , _rpi_ws281x .ws2811_channel_t_rshift_set
125
+ )
126
+ gshift = property (
127
+ _rpi_ws281x .ws2811_channel_t_gshift_get , _rpi_ws281x .ws2811_channel_t_gshift_set
128
+ )
129
+ bshift = property (
130
+ _rpi_ws281x .ws2811_channel_t_bshift_get , _rpi_ws281x .ws2811_channel_t_bshift_set
131
+ )
132
+ gamma = property (
133
+ _rpi_ws281x .ws2811_channel_t_gamma_get , _rpi_ws281x .ws2811_channel_t_gamma_set
134
+ )
95
135
96
136
def __init__ (self ):
97
137
_rpi_ws281x .ws2811_channel_t_swiginit (self , _rpi_ws281x .new_ws2811_channel_t ())
138
+
98
139
__swig_destroy__ = _rpi_ws281x .delete_ws2811_channel_t
99
140
141
+
100
142
# Register ws2811_channel_t in _rpi_ws281x:
101
143
_rpi_ws281x .ws2811_channel_t_swigregister (ws2811_channel_t )
102
144
145
+
103
146
class ws2811_t (object ):
104
- thisown = property (lambda x : x .this .own (), lambda x , v : x .this .own (v ), doc = "The membership flag" )
147
+ thisown = property (
148
+ lambda x : x .this .own (), lambda x , v : x .this .own (v ), doc = "The membership flag"
149
+ )
105
150
__repr__ = _swig_repr
106
- render_wait_time = property (_rpi_ws281x .ws2811_t_render_wait_time_get , _rpi_ws281x .ws2811_t_render_wait_time_set )
151
+ render_wait_time = property (
152
+ _rpi_ws281x .ws2811_t_render_wait_time_get ,
153
+ _rpi_ws281x .ws2811_t_render_wait_time_set ,
154
+ )
107
155
device = property (_rpi_ws281x .ws2811_t_device_get , _rpi_ws281x .ws2811_t_device_set )
108
156
rpi_hw = property (_rpi_ws281x .ws2811_t_rpi_hw_get , _rpi_ws281x .ws2811_t_rpi_hw_set )
109
157
freq = property (_rpi_ws281x .ws2811_t_freq_get , _rpi_ws281x .ws2811_t_freq_set )
110
158
dmanum = property (_rpi_ws281x .ws2811_t_dmanum_get , _rpi_ws281x .ws2811_t_dmanum_set )
111
- channel = property (_rpi_ws281x .ws2811_t_channel_get , _rpi_ws281x .ws2811_t_channel_set )
159
+ channel = property (
160
+ _rpi_ws281x .ws2811_t_channel_get , _rpi_ws281x .ws2811_t_channel_set
161
+ )
112
162
113
163
def __init__ (self ):
114
164
_rpi_ws281x .ws2811_t_swiginit (self , _rpi_ws281x .new_ws2811_t ())
165
+
115
166
__swig_destroy__ = _rpi_ws281x .delete_ws2811_t
116
167
168
+
117
169
# Register ws2811_t in _rpi_ws281x:
118
170
_rpi_ws281x .ws2811_t_swigregister (ws2811_t )
119
171
@@ -134,31 +186,38 @@ def __init__(self):
134
186
WS2811_ERROR_SPI_TRANSFER = _rpi_ws281x .WS2811_ERROR_SPI_TRANSFER
135
187
WS2811_RETURN_STATE_COUNT = _rpi_ws281x .WS2811_RETURN_STATE_COUNT
136
188
189
+
137
190
def ws2811_init (ws2811 ):
138
191
return _rpi_ws281x .ws2811_init (ws2811 )
139
192
193
+
140
194
def ws2811_fini (ws2811 ):
141
195
return _rpi_ws281x .ws2811_fini (ws2811 )
142
196
197
+
143
198
def ws2811_render (ws2811 ):
144
199
return _rpi_ws281x .ws2811_render (ws2811 )
145
200
201
+
146
202
def ws2811_wait (ws2811 ):
147
203
return _rpi_ws281x .ws2811_wait (ws2811 )
148
204
205
+
149
206
def ws2811_get_return_t_str (state ):
150
207
return _rpi_ws281x .ws2811_get_return_t_str (state )
151
208
209
+
152
210
def ws2811_set_custom_gamma_factor (ws2811 , gamma_factor ):
153
211
return _rpi_ws281x .ws2811_set_custom_gamma_factor (ws2811 , gamma_factor )
154
212
213
+
155
214
def ws2811_led_get (channel , lednum ):
156
215
return _rpi_ws281x .ws2811_led_get (channel , lednum )
157
216
217
+
158
218
def ws2811_led_set (channel , lednum , color ):
159
219
return _rpi_ws281x .ws2811_led_set (channel , lednum , color )
160
220
221
+
161
222
def ws2811_channel_get (ws , channelnum ):
162
223
return _rpi_ws281x .ws2811_channel_get (ws , channelnum )
163
-
164
-
0 commit comments