fastled 1.1.37__tar.gz → 1.1.39__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. {fastled-1.1.37/src/fastled.egg-info → fastled-1.1.39}/PKG-INFO +114 -19
  2. fastled-1.1.37/PKG-INFO → fastled-1.1.39/README.md +292 -220
  3. {fastled-1.1.37 → fastled-1.1.39}/examples/XYMatrix/XYMatrix.ino +2 -0
  4. {fastled-1.1.37 → fastled-1.1.39}/src/fastled/__init__.py +44 -7
  5. {fastled-1.1.37 → fastled-1.1.39}/src/fastled/client_server.py +114 -75
  6. {fastled-1.1.37 → fastled-1.1.39}/src/fastled/compile_server.py +8 -3
  7. {fastled-1.1.37 → fastled-1.1.39}/src/fastled/compile_server_impl.py +29 -22
  8. fastled-1.1.39/src/fastled/live_client.py +69 -0
  9. fastled-1.1.39/src/fastled/types.py +61 -0
  10. {fastled-1.1.37 → fastled-1.1.39}/src/fastled/web_compile.py +7 -8
  11. fastled-1.1.37/README.md → fastled-1.1.39/src/fastled.egg-info/PKG-INFO +315 -197
  12. {fastled-1.1.37 → fastled-1.1.39}/src/fastled.egg-info/SOURCES.txt +1 -1
  13. fastled-1.1.39/tests/test_api.py +43 -0
  14. {fastled-1.1.37 → fastled-1.1.39}/tests/test_compile_server.py +2 -2
  15. {fastled-1.1.37 → fastled-1.1.39}/tests/test_embedded_data.py +4 -4
  16. {fastled-1.1.37 → fastled-1.1.39}/tests/test_examples.py +2 -2
  17. fastled-1.1.37/src/fastled/build_mode.py +0 -25
  18. fastled-1.1.37/src/fastled/types.py +0 -25
  19. fastled-1.1.37/tests/test_api.py +0 -24
  20. {fastled-1.1.37 → fastled-1.1.39}/.aiderignore +0 -0
  21. {fastled-1.1.37 → fastled-1.1.39}/.github/workflows/build_multi_docker_image.yml +0 -0
  22. {fastled-1.1.37 → fastled-1.1.39}/.github/workflows/lint.yml +0 -0
  23. {fastled-1.1.37 → fastled-1.1.39}/.github/workflows/test_macos.yml +0 -0
  24. {fastled-1.1.37 → fastled-1.1.39}/.github/workflows/test_ubuntu.yml +0 -0
  25. {fastled-1.1.37 → fastled-1.1.39}/.github/workflows/test_win.yml +0 -0
  26. {fastled-1.1.37 → fastled-1.1.39}/.gitignore +0 -0
  27. {fastled-1.1.37 → fastled-1.1.39}/.pylintrc +0 -0
  28. {fastled-1.1.37 → fastled-1.1.39}/.vscode/launch.json +0 -0
  29. {fastled-1.1.37 → fastled-1.1.39}/.vscode/settings.json +0 -0
  30. {fastled-1.1.37 → fastled-1.1.39}/.vscode/tasks.json +0 -0
  31. {fastled-1.1.37 → fastled-1.1.39}/LICENSE +0 -0
  32. {fastled-1.1.37 → fastled-1.1.39}/MANIFEST.in +0 -0
  33. {fastled-1.1.37 → fastled-1.1.39}/clean +0 -0
  34. {fastled-1.1.37 → fastled-1.1.39}/docs/fastled.js +0 -0
  35. {fastled-1.1.37 → fastled-1.1.39}/docs/fastled.wasm +0 -0
  36. {fastled-1.1.37 → fastled-1.1.39}/docs/index.css +0 -0
  37. {fastled-1.1.37 → fastled-1.1.39}/docs/index.html +0 -0
  38. {fastled-1.1.37 → fastled-1.1.39}/docs/index.js +0 -0
  39. {fastled-1.1.37 → fastled-1.1.39}/examples/Blink/Blink.ino +0 -0
  40. {fastled-1.1.37 → fastled-1.1.39}/examples/Chromancer/Chromancer.ino +0 -0
  41. {fastled-1.1.37 → fastled-1.1.39}/examples/Chromancer/detail.h +0 -0
  42. {fastled-1.1.37 → fastled-1.1.39}/examples/Chromancer/gary_woos_wled_port/gary_woos_wled_ledmap.h +0 -0
  43. {fastled-1.1.37 → fastled-1.1.39}/examples/Chromancer/gary_woos_wled_port/presets.json +0 -0
  44. {fastled-1.1.37 → fastled-1.1.39}/examples/Chromancer/gary_woos_wled_port/presets.min.json +0 -0
  45. {fastled-1.1.37 → fastled-1.1.39}/examples/Chromancer/gen.py +0 -0
  46. {fastled-1.1.37 → fastled-1.1.39}/examples/Chromancer/mapping.h +0 -0
  47. {fastled-1.1.37 → fastled-1.1.39}/examples/Chromancer/net.h +0 -0
  48. {fastled-1.1.37 → fastled-1.1.39}/examples/Chromancer/output.json +0 -0
  49. {fastled-1.1.37 → fastled-1.1.39}/examples/Chromancer/ripple.h +0 -0
  50. {fastled-1.1.37 → fastled-1.1.39}/examples/Chromancer/screenmap.json.h +0 -0
  51. {fastled-1.1.37 → fastled-1.1.39}/examples/ColorPalette/ColorPalette.ino +0 -0
  52. {fastled-1.1.37 → fastled-1.1.39}/examples/ColorTemperature/ColorTemperature.ino +0 -0
  53. {fastled-1.1.37 → fastled-1.1.39}/examples/Cylon/Cylon.ino +0 -0
  54. {fastled-1.1.37 → fastled-1.1.39}/examples/DemoReel100/DemoReel100.ino +0 -0
  55. {fastled-1.1.37 → fastled-1.1.39}/examples/Esp32Rmt51/Esp32Rmt51.ino +0 -0
  56. {fastled-1.1.37 → fastled-1.1.39}/examples/EspI2SDemo/EspI2SDemo.ino +0 -0
  57. {fastled-1.1.37 → fastled-1.1.39}/examples/Fire2012/Fire2012.ino +0 -0
  58. {fastled-1.1.37 → fastled-1.1.39}/examples/Fire2012WithPalette/Fire2012WithPalette.ino +0 -0
  59. {fastled-1.1.37 → fastled-1.1.39}/examples/FirstLight/FirstLight.ino +0 -0
  60. {fastled-1.1.37 → fastled-1.1.39}/examples/FxEngine/FxEngine.ino +0 -0
  61. {fastled-1.1.37 → fastled-1.1.39}/examples/Noise/Noise.ino +0 -0
  62. {fastled-1.1.37 → fastled-1.1.39}/examples/NoisePlayground/NoisePlayground.ino +0 -0
  63. {fastled-1.1.37 → fastled-1.1.39}/examples/NoisePlusPalette/NoisePlusPalette.ino +0 -0
  64. {fastled-1.1.37 → fastled-1.1.39}/examples/OctoWS2811/OctoWS2811.ino +0 -0
  65. {fastled-1.1.37 → fastled-1.1.39}/examples/Pacifica/Pacifica.ino +0 -0
  66. {fastled-1.1.37 → fastled-1.1.39}/examples/Pride2015/Pride2015.ino +0 -0
  67. {fastled-1.1.37 → fastled-1.1.39}/examples/TwinkleFox/TwinkleFox.ino +0 -0
  68. {fastled-1.1.37 → fastled-1.1.39}/examples/Video/Gfx2Video/Gfx2Video.ino +0 -0
  69. {fastled-1.1.37 → fastled-1.1.39}/examples/WasmScreenCoords/WasmScreenCoords.ino +0 -0
  70. {fastled-1.1.37 → fastled-1.1.39}/examples/Water/Water.ino +0 -0
  71. {fastled-1.1.37 → fastled-1.1.39}/examples/wasm/wasm.ino +0 -0
  72. {fastled-1.1.37 → fastled-1.1.39}/install +0 -0
  73. {fastled-1.1.37 → fastled-1.1.39}/lint +0 -0
  74. {fastled-1.1.37 → fastled-1.1.39}/pyproject.toml +0 -0
  75. {fastled-1.1.37 → fastled-1.1.39}/requirements.testing.txt +0 -0
  76. {fastled-1.1.37 → fastled-1.1.39}/setup.cfg +0 -0
  77. {fastled-1.1.37 → fastled-1.1.39}/setup.py +0 -0
  78. {fastled-1.1.37 → fastled-1.1.39}/src/fastled/app.py +0 -0
  79. {fastled-1.1.37 → fastled-1.1.39}/src/fastled/assets/example.txt +0 -0
  80. {fastled-1.1.37 → fastled-1.1.39}/src/fastled/cli.py +0 -0
  81. {fastled-1.1.37 → fastled-1.1.39}/src/fastled/docker_manager.py +0 -0
  82. {fastled-1.1.37 → fastled-1.1.39}/src/fastled/filewatcher.py +0 -0
  83. {fastled-1.1.37 → fastled-1.1.39}/src/fastled/keyboard.py +0 -0
  84. {fastled-1.1.37 → fastled-1.1.39}/src/fastled/open_browser.py +0 -0
  85. {fastled-1.1.37 → fastled-1.1.39}/src/fastled/parse_args.py +0 -0
  86. {fastled-1.1.37 → fastled-1.1.39}/src/fastled/paths.py +0 -0
  87. {fastled-1.1.37 → fastled-1.1.39}/src/fastled/project_init.py +0 -0
  88. {fastled-1.1.37 → fastled-1.1.39}/src/fastled/select_sketch_directory.py +0 -0
  89. {fastled-1.1.37 → fastled-1.1.39}/src/fastled/settings.py +0 -0
  90. {fastled-1.1.37 → fastled-1.1.39}/src/fastled/sketch.py +0 -0
  91. {fastled-1.1.37 → fastled-1.1.39}/src/fastled/spinner.py +0 -0
  92. {fastled-1.1.37 → fastled-1.1.39}/src/fastled/string_diff.py +0 -0
  93. {fastled-1.1.37 → fastled-1.1.39}/src/fastled/test/examples.py +0 -0
  94. {fastled-1.1.37 → fastled-1.1.39}/src/fastled/util.py +0 -0
  95. {fastled-1.1.37 → fastled-1.1.39}/src/fastled.egg-info/dependency_links.txt +0 -0
  96. {fastled-1.1.37 → fastled-1.1.39}/src/fastled.egg-info/entry_points.txt +0 -0
  97. {fastled-1.1.37 → fastled-1.1.39}/src/fastled.egg-info/requires.txt +0 -0
  98. {fastled-1.1.37 → fastled-1.1.39}/src/fastled.egg-info/top_level.txt +0 -0
  99. {fastled-1.1.37 → fastled-1.1.39}/test +0 -0
  100. {fastled-1.1.37 → fastled-1.1.39}/tests/test_bad_ino.py +0 -0
  101. {fastled-1.1.37 → fastled-1.1.39}/tests/test_cli.py +0 -0
  102. {fastled-1.1.37 → fastled-1.1.39}/tests/test_docker_linux_on_windows.py +0 -0
  103. {fastled-1.1.37 → fastled-1.1.39}/tests/test_filechanger.py +0 -0
  104. {fastled-1.1.37 → fastled-1.1.39}/tests/test_ino/bad/bad.ino +0 -0
  105. {fastled-1.1.37 → fastled-1.1.39}/tests/test_ino/embedded/data/bigdata.dat +0 -0
  106. {fastled-1.1.37 → fastled-1.1.39}/tests/test_ino/embedded/wasm.ino +0 -0
  107. {fastled-1.1.37 → fastled-1.1.39}/tests/test_ino/wasm/wasm.ino +0 -0
  108. {fastled-1.1.37 → fastled-1.1.39}/tests/test_project_init.py +0 -0
  109. {fastled-1.1.37 → fastled-1.1.39}/tests/test_server_and_client_seperatly.py +0 -0
  110. {fastled-1.1.37 → fastled-1.1.39}/tests/test_webcompile.py +0 -0
  111. {fastled-1.1.37 → fastled-1.1.39}/upload_package.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastled
3
- Version: 1.1.37
3
+ Version: 1.1.39
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -61,60 +61,155 @@ pip install fastled
61
61
 
62
62
  **Note that you may need to install x86 docker emulation on Mac-m1 and later, as this is an x86 only image at the prsent.**
63
63
 
64
- # Use
64
+ # Command Line Use
65
65
 
66
66
  Change to the directory where the sketch lives and run, will run the compilation
67
67
  on the web compiler.
68
68
 
69
69
  ```bash
70
+ # This will use the web-compiler, unless you have docker installed in which case a local
71
+ # server will be instantiated automatically.
70
72
  cd <SKETCH-DIRECTORY>
71
73
  fastled
72
74
  ```
73
75
 
74
- Or if you have docker you can run a server automatically.
76
+ Forces the local server to to spawn in order to run to do the compile.
75
77
 
76
78
  ```bash
77
79
  cd <SKETCH-DIRECTORY>
78
- fastled --local
80
+ fastled --local # if server doesn't already exist, one is created.
79
81
  ```
80
82
 
81
83
  You can also spawn a server in one process and then access it in another, like this:
82
84
 
83
85
  ```bash
84
- fastled --server
86
+ fastled --server # server will now run in the background.
85
87
  # now launch the client
86
- fastled examples/wasm --local
88
+ fastled examples/wasm --local # local will find the local server use it do the compile.
87
89
  ```
88
90
 
89
91
  After compilation a web browser windows will pop up. Changes to the sketch will automatically trigger a recompilation.
90
92
 
91
- # Hot reload by default
93
+ # Python Api
94
+
95
+ **Compiling through the api**
96
+ ```python
97
+
98
+ from fastapi import Api, CompileResult
99
+
100
+ out: CompileResult = Api.web_compile("path/to/sketch")
101
+ print(out.success)
102
+ print(out.stdout)
103
+
104
+ ```
105
+
106
+ **Launching a compile server**
107
+ ```python
108
+
109
+ from fastapi import Api, CompileServer
110
+
111
+ server: CompileServer = Api.spawn_server()
112
+ print(f"Local server running at {server.url()}")
113
+ server.web_compile("path/to/sketch") # output will be "path/to/sketch/fastled_js"
114
+ server.stop()
115
+ ```
116
+
117
+ **Launching a server in a scope**
118
+ ```python
119
+
120
+ from fastapi import Api
121
+
122
+ # Launching a server in a scope
123
+ with Api.server() as server:
124
+ server.web_compile("path/to/sketch")
125
+
126
+ ```
127
+
128
+ **Initializing a project example from the web compiler**
129
+ ```python
130
+
131
+ from fastapi import Api
132
+
133
+ examples = Api.get_examples()
134
+ print(f"Print available examples: {examples}")
135
+ Api.project_init(examples[0])
136
+
137
+
138
+ ```
139
+
140
+ **Initializing a project example from the CompileServer**
141
+ ```python
142
+
143
+ from fastapi import Api
144
+
145
+ with Api.server() as server:
146
+ examples = server.get_examples()
147
+ server.project_init(examples[0])
148
+
149
+ ```
150
+
151
+ **LiveClient will auto-trigger a build on code changes, just like the cli does**
152
+ ```python
153
+
154
+ # Live Client will compile against the web-compiler
155
+ from fastapi import Api, LiveClient
156
+ client: LiveClient = Api.live_client(
157
+ "path/to/sketch_directory",
158
+ )
159
+ # Now user can start editing their sketch and it will auto-compile
160
+ # ... after a while stop it like this.
161
+ client.stop()
162
+ ```
163
+
164
+ **LiveClient with local CompileServer**
165
+ ```python
166
+
167
+ # Live Client will compile against a local server.
168
+ from fastapi import Api, LiveClient
169
+
170
+ with Api.server() as server:
171
+ client: LiveClient = Api.live_client(
172
+ "path/to/sketch_directory",
173
+ host=server
174
+ )
175
+ # Now user can start editing their sketch and it will auto-compile
176
+ # ... after a while stop it like this.
177
+ client.stop()
178
+ ```
179
+
180
+ # Features
181
+
182
+ ## Hot reload by default
92
183
 
93
184
  Once launched, the compiler will remain open, listening to changes and recompiling as necessary and hot-reloading the sketch into the current browser.
94
185
 
95
186
  This style of development should be familiar to those doing web development.
96
187
 
97
- # Hot Reload for working with the FastLED repo
188
+ ## Hot Reload fastled/src when working in the FastLED repo
98
189
 
99
190
  If you launch `fastled` in the FastLED repo then this tool will automatically detect this and map the src directory into the
100
191
  host container. Whenever there are changes in the source code from the mapped directory, then these will be re-compiled
101
192
  on the next change or if you hit the space bar when prompted. Unlike a sketch folder, a re-compile on the FastLED src
102
193
  can be much longer, for example if you modify a header file.
103
194
 
104
- # Data
195
+ ## Big Data in `/data` directory won't be round-tripped
105
196
 
106
197
  Huge blobs of data like video will absolutely kill the compile performance as these blobs would normally have to be shuffled
107
198
  back and forth. Therefore a special directory `data/` is implicitly used to hold this blob data. Any data in this directory
108
199
  will be replaced with a stub containing the size and hash of the file during upload. On download these stubs are swapped back
109
- with their originals.
200
+ with their originals during decompression.
110
201
 
111
202
  The wasm compiler will recognize all files in the `data/` directory and generate a `files.json` manifest and can be used
112
203
  in your wasm sketch using an emulated SD card system mounted at `/data/` on the SD Card. In order to increase load speed, these
113
- files will be asynchroniously streamed into the running sketch instance during runtime. The only caveat here is that although these files will be available during the setup() phase of the sketch, they will not be fully hydrated, so if you do a seek(end) of these files the results are undefined.
204
+ files will be asynchroniously streamed into the running sketch instance during runtime. Files named with *.json, *.csv, *.txt will be
205
+ immediately injected in the app before setup() is called and can be used immediatly in setup() in their entirety.
206
+
207
+ All other files will be streamed in. The `Video` element in FastLED is designed to gracefully handle missing data streamed in through
208
+ the file system.
114
209
 
115
210
  For an example of how to use this see `examples/SdCard` which is fully wasm compatible.
116
211
 
117
- # Compile Speed
212
+ ## Compile Speed
118
213
 
119
214
  The compile speeds for this compiler have been optimized pretty much to the max. There are three compile settings available to the user. The default is `--quick`. Aggressive optimizations are done with `--release` which will aggressively optimize for size. The speed difference between `--release` and `--quick` seems negligable. But `--release` will produce a ~1/3 smaller binary. There is also `--debug`, which will include symbols necessary for debugging and getting the C++ function symbols working correctly in the browser during step through debugging. It works better than expected, but don't expect to have gdb or msvc debugger level of debugging experience.
120
215
 
@@ -122,24 +217,22 @@ We use `ccache` to cache object files. This seems actually help a lot and is bet
122
217
 
123
218
  The compilation to wasm will happen under a lock. Removing this lock requires removing the platformio toolchain as the compiler backend which enforces it's own internal lock preventing parallel use.
124
219
 
125
- Simple syntax errors will be caught by the pre-processing step. This happens without a lock to reduce the single lock bottleneck.
126
-
127
- # Sketch Cache
220
+ ## Sketch Cache
128
221
 
129
- Sketchs are aggresively finger-printed and stored in a cache. White space, comments, and other superficial data will be stripped out during pre-processing and minimization for fingerprinting. This source file decimation is only used for finger
222
+ Sketchs are aggressively finger-printed and stored in a cache. White space, comments, and other superficial data will be stripped out during pre-processing and minimization for fingerprinting. This source file decimation is only used for finger
130
223
  printing while the actual source files are sent to compiler to preserve line numbers and file names.
131
224
 
132
225
  This pre-processing done is done via gcc and special regex's and will happen without a lock. This will allow you to have extremely quick recompiles for whitespace and changes in comments even if the compiler is executing under it's lock.
133
226
 
134
- # Local compiles
227
+ ## Local compiles
135
228
 
136
229
  If the web-compiler get's congested then it's recommend that you run the compiler locally. This requires docker and will be invoked whenever you pass in `--local`. This will first pull the most recent Docker image of the Fastled compiler, launching a webserver and then connecting to it with the client once it's been up.
137
230
 
138
- # Auto updates
231
+ ## Auto updates
139
232
 
140
233
  In server mode the git repository will be cloned as a side repo and then periodically updated and rsync'd to the src directory. This allows a long running instance to stay updated.
141
234
 
142
- ### Wasm compatibility with Arduino sketchs
235
+ ## Compatibility with Arduino sketchs
143
236
 
144
237
  The compatibility is actually pretty good. Most simple sketchs should compile out of the box. Even some of the avr platform includes are stubbed out to make it work. The familiar `digitalWrite()`, `Serial.println()` and other common functions work. Although `digitalRead()` will always return 0 and `analogRead()` will return random numbers.
145
238
 
@@ -163,6 +256,8 @@ A: A big chunk of space is being used by unnecessary javascript `emscripten` is
163
256
 
164
257
  # Revisions
165
258
 
259
+ * 1.1.39 - Added `LiveClient`, `fastled.Api.live_server()` will spawn it. Allows user to have a live compiling client that re-triggers a compile on file changes.
260
+ * 1.1.38 - Cleanup the `fastled.Api` object and streamline for general use.
166
261
  * 1.1.37 - `Test.test_examples()` is now unit tested to work correctly.
167
262
  * 1.1.36 - We now have an api. `from fastled import Api` and `from fastled import Test` for testing.
168
263
  * 1.1.35 - When searching for files cap the limit at a high amount to prevent hang.