fastled 1.1.37__tar.gz → 1.1.38__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 (109) hide show
  1. {fastled-1.1.37/src/fastled.egg-info → fastled-1.1.38}/PKG-INFO +77 -14
  2. fastled-1.1.37/PKG-INFO → fastled-1.1.38/README.md +260 -220
  3. {fastled-1.1.37 → fastled-1.1.38}/examples/XYMatrix/XYMatrix.ino +2 -0
  4. {fastled-1.1.37 → fastled-1.1.38}/src/fastled/__init__.py +23 -7
  5. {fastled-1.1.37 → fastled-1.1.38}/src/fastled/client_server.py +45 -39
  6. {fastled-1.1.37 → fastled-1.1.38}/src/fastled/compile_server.py +5 -3
  7. {fastled-1.1.37 → fastled-1.1.38}/src/fastled/compile_server_impl.py +29 -22
  8. fastled-1.1.38/src/fastled/types.py +47 -0
  9. {fastled-1.1.37 → fastled-1.1.38}/src/fastled/web_compile.py +7 -8
  10. fastled-1.1.37/README.md → fastled-1.1.38/src/fastled.egg-info/PKG-INFO +283 -197
  11. {fastled-1.1.37 → fastled-1.1.38}/src/fastled.egg-info/SOURCES.txt +0 -1
  12. {fastled-1.1.37 → fastled-1.1.38}/tests/test_compile_server.py +2 -2
  13. {fastled-1.1.37 → fastled-1.1.38}/tests/test_embedded_data.py +4 -4
  14. {fastled-1.1.37 → fastled-1.1.38}/tests/test_examples.py +2 -2
  15. fastled-1.1.37/src/fastled/build_mode.py +0 -25
  16. fastled-1.1.37/src/fastled/types.py +0 -25
  17. {fastled-1.1.37 → fastled-1.1.38}/.aiderignore +0 -0
  18. {fastled-1.1.37 → fastled-1.1.38}/.github/workflows/build_multi_docker_image.yml +0 -0
  19. {fastled-1.1.37 → fastled-1.1.38}/.github/workflows/lint.yml +0 -0
  20. {fastled-1.1.37 → fastled-1.1.38}/.github/workflows/test_macos.yml +0 -0
  21. {fastled-1.1.37 → fastled-1.1.38}/.github/workflows/test_ubuntu.yml +0 -0
  22. {fastled-1.1.37 → fastled-1.1.38}/.github/workflows/test_win.yml +0 -0
  23. {fastled-1.1.37 → fastled-1.1.38}/.gitignore +0 -0
  24. {fastled-1.1.37 → fastled-1.1.38}/.pylintrc +0 -0
  25. {fastled-1.1.37 → fastled-1.1.38}/.vscode/launch.json +0 -0
  26. {fastled-1.1.37 → fastled-1.1.38}/.vscode/settings.json +0 -0
  27. {fastled-1.1.37 → fastled-1.1.38}/.vscode/tasks.json +0 -0
  28. {fastled-1.1.37 → fastled-1.1.38}/LICENSE +0 -0
  29. {fastled-1.1.37 → fastled-1.1.38}/MANIFEST.in +0 -0
  30. {fastled-1.1.37 → fastled-1.1.38}/clean +0 -0
  31. {fastled-1.1.37 → fastled-1.1.38}/docs/fastled.js +0 -0
  32. {fastled-1.1.37 → fastled-1.1.38}/docs/fastled.wasm +0 -0
  33. {fastled-1.1.37 → fastled-1.1.38}/docs/index.css +0 -0
  34. {fastled-1.1.37 → fastled-1.1.38}/docs/index.html +0 -0
  35. {fastled-1.1.37 → fastled-1.1.38}/docs/index.js +0 -0
  36. {fastled-1.1.37 → fastled-1.1.38}/examples/Blink/Blink.ino +0 -0
  37. {fastled-1.1.37 → fastled-1.1.38}/examples/Chromancer/Chromancer.ino +0 -0
  38. {fastled-1.1.37 → fastled-1.1.38}/examples/Chromancer/detail.h +0 -0
  39. {fastled-1.1.37 → fastled-1.1.38}/examples/Chromancer/gary_woos_wled_port/gary_woos_wled_ledmap.h +0 -0
  40. {fastled-1.1.37 → fastled-1.1.38}/examples/Chromancer/gary_woos_wled_port/presets.json +0 -0
  41. {fastled-1.1.37 → fastled-1.1.38}/examples/Chromancer/gary_woos_wled_port/presets.min.json +0 -0
  42. {fastled-1.1.37 → fastled-1.1.38}/examples/Chromancer/gen.py +0 -0
  43. {fastled-1.1.37 → fastled-1.1.38}/examples/Chromancer/mapping.h +0 -0
  44. {fastled-1.1.37 → fastled-1.1.38}/examples/Chromancer/net.h +0 -0
  45. {fastled-1.1.37 → fastled-1.1.38}/examples/Chromancer/output.json +0 -0
  46. {fastled-1.1.37 → fastled-1.1.38}/examples/Chromancer/ripple.h +0 -0
  47. {fastled-1.1.37 → fastled-1.1.38}/examples/Chromancer/screenmap.json.h +0 -0
  48. {fastled-1.1.37 → fastled-1.1.38}/examples/ColorPalette/ColorPalette.ino +0 -0
  49. {fastled-1.1.37 → fastled-1.1.38}/examples/ColorTemperature/ColorTemperature.ino +0 -0
  50. {fastled-1.1.37 → fastled-1.1.38}/examples/Cylon/Cylon.ino +0 -0
  51. {fastled-1.1.37 → fastled-1.1.38}/examples/DemoReel100/DemoReel100.ino +0 -0
  52. {fastled-1.1.37 → fastled-1.1.38}/examples/Esp32Rmt51/Esp32Rmt51.ino +0 -0
  53. {fastled-1.1.37 → fastled-1.1.38}/examples/EspI2SDemo/EspI2SDemo.ino +0 -0
  54. {fastled-1.1.37 → fastled-1.1.38}/examples/Fire2012/Fire2012.ino +0 -0
  55. {fastled-1.1.37 → fastled-1.1.38}/examples/Fire2012WithPalette/Fire2012WithPalette.ino +0 -0
  56. {fastled-1.1.37 → fastled-1.1.38}/examples/FirstLight/FirstLight.ino +0 -0
  57. {fastled-1.1.37 → fastled-1.1.38}/examples/FxEngine/FxEngine.ino +0 -0
  58. {fastled-1.1.37 → fastled-1.1.38}/examples/Noise/Noise.ino +0 -0
  59. {fastled-1.1.37 → fastled-1.1.38}/examples/NoisePlayground/NoisePlayground.ino +0 -0
  60. {fastled-1.1.37 → fastled-1.1.38}/examples/NoisePlusPalette/NoisePlusPalette.ino +0 -0
  61. {fastled-1.1.37 → fastled-1.1.38}/examples/OctoWS2811/OctoWS2811.ino +0 -0
  62. {fastled-1.1.37 → fastled-1.1.38}/examples/Pacifica/Pacifica.ino +0 -0
  63. {fastled-1.1.37 → fastled-1.1.38}/examples/Pride2015/Pride2015.ino +0 -0
  64. {fastled-1.1.37 → fastled-1.1.38}/examples/TwinkleFox/TwinkleFox.ino +0 -0
  65. {fastled-1.1.37 → fastled-1.1.38}/examples/Video/Gfx2Video/Gfx2Video.ino +0 -0
  66. {fastled-1.1.37 → fastled-1.1.38}/examples/WasmScreenCoords/WasmScreenCoords.ino +0 -0
  67. {fastled-1.1.37 → fastled-1.1.38}/examples/Water/Water.ino +0 -0
  68. {fastled-1.1.37 → fastled-1.1.38}/examples/wasm/wasm.ino +0 -0
  69. {fastled-1.1.37 → fastled-1.1.38}/install +0 -0
  70. {fastled-1.1.37 → fastled-1.1.38}/lint +0 -0
  71. {fastled-1.1.37 → fastled-1.1.38}/pyproject.toml +0 -0
  72. {fastled-1.1.37 → fastled-1.1.38}/requirements.testing.txt +0 -0
  73. {fastled-1.1.37 → fastled-1.1.38}/setup.cfg +0 -0
  74. {fastled-1.1.37 → fastled-1.1.38}/setup.py +0 -0
  75. {fastled-1.1.37 → fastled-1.1.38}/src/fastled/app.py +0 -0
  76. {fastled-1.1.37 → fastled-1.1.38}/src/fastled/assets/example.txt +0 -0
  77. {fastled-1.1.37 → fastled-1.1.38}/src/fastled/cli.py +0 -0
  78. {fastled-1.1.37 → fastled-1.1.38}/src/fastled/docker_manager.py +0 -0
  79. {fastled-1.1.37 → fastled-1.1.38}/src/fastled/filewatcher.py +0 -0
  80. {fastled-1.1.37 → fastled-1.1.38}/src/fastled/keyboard.py +0 -0
  81. {fastled-1.1.37 → fastled-1.1.38}/src/fastled/open_browser.py +0 -0
  82. {fastled-1.1.37 → fastled-1.1.38}/src/fastled/parse_args.py +0 -0
  83. {fastled-1.1.37 → fastled-1.1.38}/src/fastled/paths.py +0 -0
  84. {fastled-1.1.37 → fastled-1.1.38}/src/fastled/project_init.py +0 -0
  85. {fastled-1.1.37 → fastled-1.1.38}/src/fastled/select_sketch_directory.py +0 -0
  86. {fastled-1.1.37 → fastled-1.1.38}/src/fastled/settings.py +0 -0
  87. {fastled-1.1.37 → fastled-1.1.38}/src/fastled/sketch.py +0 -0
  88. {fastled-1.1.37 → fastled-1.1.38}/src/fastled/spinner.py +0 -0
  89. {fastled-1.1.37 → fastled-1.1.38}/src/fastled/string_diff.py +0 -0
  90. {fastled-1.1.37 → fastled-1.1.38}/src/fastled/test/examples.py +0 -0
  91. {fastled-1.1.37 → fastled-1.1.38}/src/fastled/util.py +0 -0
  92. {fastled-1.1.37 → fastled-1.1.38}/src/fastled.egg-info/dependency_links.txt +0 -0
  93. {fastled-1.1.37 → fastled-1.1.38}/src/fastled.egg-info/entry_points.txt +0 -0
  94. {fastled-1.1.37 → fastled-1.1.38}/src/fastled.egg-info/requires.txt +0 -0
  95. {fastled-1.1.37 → fastled-1.1.38}/src/fastled.egg-info/top_level.txt +0 -0
  96. {fastled-1.1.37 → fastled-1.1.38}/test +0 -0
  97. {fastled-1.1.37 → fastled-1.1.38}/tests/test_api.py +0 -0
  98. {fastled-1.1.37 → fastled-1.1.38}/tests/test_bad_ino.py +0 -0
  99. {fastled-1.1.37 → fastled-1.1.38}/tests/test_cli.py +0 -0
  100. {fastled-1.1.37 → fastled-1.1.38}/tests/test_docker_linux_on_windows.py +0 -0
  101. {fastled-1.1.37 → fastled-1.1.38}/tests/test_filechanger.py +0 -0
  102. {fastled-1.1.37 → fastled-1.1.38}/tests/test_ino/bad/bad.ino +0 -0
  103. {fastled-1.1.37 → fastled-1.1.38}/tests/test_ino/embedded/data/bigdata.dat +0 -0
  104. {fastled-1.1.37 → fastled-1.1.38}/tests/test_ino/embedded/wasm.ino +0 -0
  105. {fastled-1.1.37 → fastled-1.1.38}/tests/test_ino/wasm/wasm.ino +0 -0
  106. {fastled-1.1.37 → fastled-1.1.38}/tests/test_project_init.py +0 -0
  107. {fastled-1.1.37 → fastled-1.1.38}/tests/test_server_and_client_seperatly.py +0 -0
  108. {fastled-1.1.37 → fastled-1.1.38}/tests/test_webcompile.py +0 -0
  109. {fastled-1.1.37 → fastled-1.1.38}/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.38
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -61,47 +61,109 @@ 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
+ # Features
152
+
153
+ ## Hot reload by default
92
154
 
93
155
  Once launched, the compiler will remain open, listening to changes and recompiling as necessary and hot-reloading the sketch into the current browser.
94
156
 
95
157
  This style of development should be familiar to those doing web development.
96
158
 
97
- # Hot Reload for working with the FastLED repo
159
+ ## Hot Reload fastled/src when working in the FastLED repo
98
160
 
99
161
  If you launch `fastled` in the FastLED repo then this tool will automatically detect this and map the src directory into the
100
162
  host container. Whenever there are changes in the source code from the mapped directory, then these will be re-compiled
101
163
  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
164
  can be much longer, for example if you modify a header file.
103
165
 
104
- # Data
166
+ ## Big Data in `/data` directory won't be round-tripped
105
167
 
106
168
  Huge blobs of data like video will absolutely kill the compile performance as these blobs would normally have to be shuffled
107
169
  back and forth. Therefore a special directory `data/` is implicitly used to hold this blob data. Any data in this directory
@@ -114,7 +176,7 @@ files will be asynchroniously streamed into the running sketch instance during r
114
176
 
115
177
  For an example of how to use this see `examples/SdCard` which is fully wasm compatible.
116
178
 
117
- # Compile Speed
179
+ ## Compile Speed
118
180
 
119
181
  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
182
 
@@ -124,22 +186,22 @@ The compilation to wasm will happen under a lock. Removing this lock requires re
124
186
 
125
187
  Simple syntax errors will be caught by the pre-processing step. This happens without a lock to reduce the single lock bottleneck.
126
188
 
127
- # Sketch Cache
189
+ ## Sketch Cache
128
190
 
129
191
  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
130
192
  printing while the actual source files are sent to compiler to preserve line numbers and file names.
131
193
 
132
194
  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
195
 
134
- # Local compiles
196
+ ## Local compiles
135
197
 
136
198
  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
199
 
138
- # Auto updates
200
+ ## Auto updates
139
201
 
140
202
  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
203
 
142
- ### Wasm compatibility with Arduino sketchs
204
+ ## Compatibility with Arduino sketchs
143
205
 
144
206
  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
207
 
@@ -163,6 +225,7 @@ A: A big chunk of space is being used by unnecessary javascript `emscripten` is
163
225
 
164
226
  # Revisions
165
227
 
228
+ * 1.1.38 - Cleanup the `fastled.Api` object and streamline for general use.
166
229
  * 1.1.37 - `Test.test_examples()` is now unit tested to work correctly.
167
230
  * 1.1.36 - We now have an api. `from fastled import Api` and `from fastled import Test` for testing.
168
231
  * 1.1.35 - When searching for files cap the limit at a high amount to prevent hang.