fastled 1.1.38__py2.py3-none-any.whl → 1.1.41__py2.py3-none-any.whl
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.
- fastled/__init__.py +23 -5
- fastled/client_server.py +97 -58
- fastled/compile_server.py +4 -1
- fastled/live_client.py +69 -0
- fastled/parse_args.py +1 -1
- fastled/project_init.py +5 -2
- fastled/types.py +14 -0
- {fastled-1.1.38.dist-info → fastled-1.1.41.dist-info}/METADATA +45 -7
- {fastled-1.1.38.dist-info → fastled-1.1.41.dist-info}/RECORD +13 -12
- {fastled-1.1.38.dist-info → fastled-1.1.41.dist-info}/WHEEL +1 -1
- {fastled-1.1.38.dist-info → fastled-1.1.41.dist-info}/LICENSE +0 -0
- {fastled-1.1.38.dist-info → fastled-1.1.41.dist-info}/entry_points.txt +0 -0
- {fastled-1.1.38.dist-info → fastled-1.1.41.dist-info}/top_level.txt +0 -0
fastled/__init__.py
CHANGED
@@ -6,9 +6,10 @@ from pathlib import Path
|
|
6
6
|
from typing import Generator
|
7
7
|
|
8
8
|
from .compile_server import CompileServer
|
9
|
+
from .live_client import LiveClient
|
9
10
|
from .types import BuildMode, CompileResult, CompileServerError
|
10
11
|
|
11
|
-
__version__ = "1.1.
|
12
|
+
__version__ = "1.1.41"
|
12
13
|
|
13
14
|
|
14
15
|
class Api:
|
@@ -46,9 +47,28 @@ class Api:
|
|
46
47
|
)
|
47
48
|
return out
|
48
49
|
|
50
|
+
@staticmethod
|
51
|
+
def live_client(
|
52
|
+
sketch_directory: Path,
|
53
|
+
host: str | CompileServer | None = None,
|
54
|
+
auto_start=True,
|
55
|
+
open_web_browser=True,
|
56
|
+
keep_running=True,
|
57
|
+
build_mode=BuildMode.QUICK,
|
58
|
+
profile=False,
|
59
|
+
) -> LiveClient:
|
60
|
+
return LiveClient(
|
61
|
+
sketch_directory=sketch_directory,
|
62
|
+
host=host,
|
63
|
+
auto_start=auto_start,
|
64
|
+
open_web_browser=open_web_browser,
|
65
|
+
keep_running=keep_running,
|
66
|
+
build_mode=build_mode,
|
67
|
+
profile=profile,
|
68
|
+
)
|
69
|
+
|
49
70
|
@staticmethod
|
50
71
|
def spawn_server(
|
51
|
-
sketch_directory: Path | None = None,
|
52
72
|
interactive=False,
|
53
73
|
auto_updates=None,
|
54
74
|
auto_start=True,
|
@@ -60,7 +80,7 @@ class Api:
|
|
60
80
|
container_name=container_name,
|
61
81
|
interactive=interactive,
|
62
82
|
auto_updates=auto_updates,
|
63
|
-
mapped_dir=
|
83
|
+
mapped_dir=None,
|
64
84
|
auto_start=auto_start,
|
65
85
|
)
|
66
86
|
return out
|
@@ -68,14 +88,12 @@ class Api:
|
|
68
88
|
@staticmethod
|
69
89
|
@contextmanager
|
70
90
|
def server(
|
71
|
-
sketch_directory: Path | None = None,
|
72
91
|
interactive=False,
|
73
92
|
auto_updates=None,
|
74
93
|
auto_start=True,
|
75
94
|
container_name: str | None = None,
|
76
95
|
) -> Generator[CompileServer, None, None]:
|
77
96
|
server = Api.spawn_server(
|
78
|
-
sketch_directory=sketch_directory,
|
79
97
|
interactive=interactive,
|
80
98
|
auto_updates=auto_updates,
|
81
99
|
auto_start=auto_start,
|
fastled/client_server.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import argparse
|
2
2
|
import shutil
|
3
3
|
import tempfile
|
4
|
+
import threading
|
4
5
|
import time
|
5
6
|
from multiprocessing import Process
|
6
7
|
from pathlib import Path
|
@@ -12,7 +13,7 @@ from fastled.keyboard import SpaceBarWatcher
|
|
12
13
|
from fastled.open_browser import open_browser_process
|
13
14
|
from fastled.settings import DEFAULT_URL
|
14
15
|
from fastled.sketch import looks_like_sketch_directory
|
15
|
-
from fastled.types import BuildMode, CompileResult
|
16
|
+
from fastled.types import BuildMode, CompileResult, CompileServerError
|
16
17
|
from fastled.web_compile import (
|
17
18
|
SERVER_PORT,
|
18
19
|
ConnectionResult,
|
@@ -21,6 +22,11 @@ from fastled.web_compile import (
|
|
21
22
|
)
|
22
23
|
|
23
24
|
|
25
|
+
# Override this function in your own code to run tests before compilation
|
26
|
+
def TEST_BEFORE_COMPILE(url) -> None:
|
27
|
+
pass
|
28
|
+
|
29
|
+
|
24
30
|
def _run_web_compiler(
|
25
31
|
directory: Path,
|
26
32
|
host: str,
|
@@ -78,7 +84,7 @@ def _run_web_compiler(
|
|
78
84
|
|
79
85
|
def _try_start_server_or_get_url(
|
80
86
|
auto_update: bool, args_web: str | bool, localhost: bool
|
81
|
-
) -> str |
|
87
|
+
) -> tuple[str, CompileServer | None]:
|
82
88
|
is_local_host = localhost or (
|
83
89
|
isinstance(args_web, str)
|
84
90
|
and ("localhost" in args_web or "127.0.0.1" in args_web)
|
@@ -94,16 +100,16 @@ def _try_start_server_or_get_url(
|
|
94
100
|
result: ConnectionResult | None = find_good_connection(urls)
|
95
101
|
if result is not None:
|
96
102
|
print(f"Found local server at {result.host}")
|
97
|
-
return result.host
|
103
|
+
return (result.host, None)
|
98
104
|
else:
|
99
105
|
local_host_needs_server = True
|
100
106
|
|
101
107
|
if not local_host_needs_server and args_web:
|
102
108
|
if isinstance(args_web, str):
|
103
|
-
return args_web
|
109
|
+
return (args_web, None)
|
104
110
|
if isinstance(args_web, bool):
|
105
|
-
return DEFAULT_URL
|
106
|
-
return args_web
|
111
|
+
return (DEFAULT_URL, None)
|
112
|
+
return (args_web, None)
|
107
113
|
else:
|
108
114
|
try:
|
109
115
|
print("No local server found, starting one...")
|
@@ -111,63 +117,40 @@ def _try_start_server_or_get_url(
|
|
111
117
|
print("Waiting for the local compiler to start...")
|
112
118
|
if not compile_server.ping():
|
113
119
|
print("Failed to start local compiler.")
|
114
|
-
raise
|
115
|
-
return compile_server
|
120
|
+
raise CompileServerError("Failed to start local compiler.")
|
121
|
+
return (compile_server.url(), compile_server)
|
116
122
|
except KeyboardInterrupt:
|
117
123
|
raise
|
118
124
|
except RuntimeError:
|
119
125
|
print("Failed to start local compile server, using web compiler instead.")
|
120
|
-
return DEFAULT_URL
|
121
|
-
|
126
|
+
return (DEFAULT_URL, None)
|
122
127
|
|
123
|
-
def run_client_server(args: argparse.Namespace) -> int:
|
124
|
-
compile_server: CompileServer | None = None
|
125
128
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
129
|
+
def run_client(
|
130
|
+
directory: Path,
|
131
|
+
host: str | CompileServer | None,
|
132
|
+
open_web_browser: bool = True,
|
133
|
+
keep_running: bool = True, # if false, only one compilation will be done.
|
134
|
+
build_mode: BuildMode = BuildMode.QUICK,
|
135
|
+
profile: bool = False,
|
136
|
+
shutdown: threading.Event | None = None,
|
137
|
+
) -> int:
|
138
|
+
|
139
|
+
compile_server: CompileServer | None = (
|
140
|
+
host if isinstance(host, CompileServer) else None
|
141
|
+
)
|
142
|
+
shutdown = shutdown or threading.Event()
|
135
143
|
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
)
|
140
|
-
|
144
|
+
def get_url() -> str:
|
145
|
+
if compile_server is not None:
|
146
|
+
return compile_server.url()
|
147
|
+
if isinstance(host, str):
|
148
|
+
return host
|
149
|
+
return DEFAULT_URL
|
141
150
|
|
142
|
-
|
143
|
-
if not web and not DockerManager.is_docker_installed():
|
144
|
-
print(
|
145
|
-
"\nDocker is not installed on this system - switching to web compiler instead."
|
146
|
-
)
|
147
|
-
web = True
|
151
|
+
url = get_url()
|
148
152
|
|
149
|
-
url: str
|
150
153
|
try:
|
151
|
-
try:
|
152
|
-
url_or_server: str | CompileServer = _try_start_server_or_get_url(
|
153
|
-
auto_update, web, localhost
|
154
|
-
)
|
155
|
-
if isinstance(url_or_server, str):
|
156
|
-
print(f"Found URL: {url_or_server}")
|
157
|
-
url = url_or_server
|
158
|
-
else:
|
159
|
-
compile_server = url_or_server
|
160
|
-
print(f"Server started at {compile_server.url()}")
|
161
|
-
url = compile_server.url()
|
162
|
-
except KeyboardInterrupt:
|
163
|
-
print("\nExiting from first try...")
|
164
|
-
if compile_server:
|
165
|
-
compile_server.stop()
|
166
|
-
return 1
|
167
|
-
except Exception as e:
|
168
|
-
print(f"Error: {e}")
|
169
|
-
return 1
|
170
|
-
build_mode: BuildMode = BuildMode.from_args(args)
|
171
154
|
|
172
155
|
def compile_function(
|
173
156
|
url: str = url,
|
@@ -175,6 +158,7 @@ def run_client_server(args: argparse.Namespace) -> int:
|
|
175
158
|
profile: bool = profile,
|
176
159
|
last_hash_value: str | None = None,
|
177
160
|
) -> CompileResult:
|
161
|
+
TEST_BEFORE_COMPILE(url)
|
178
162
|
return _run_web_compiler(
|
179
163
|
directory,
|
180
164
|
host=url,
|
@@ -199,16 +183,12 @@ def run_client_server(args: argparse.Namespace) -> int:
|
|
199
183
|
compile_server.stop()
|
200
184
|
return 0
|
201
185
|
|
202
|
-
if
|
203
|
-
if compile_server:
|
204
|
-
compile_server.stop()
|
186
|
+
if not keep_running or shutdown.is_set():
|
205
187
|
if browser_proc:
|
206
188
|
browser_proc.kill()
|
207
189
|
return 0 if result.success else 1
|
208
190
|
except KeyboardInterrupt:
|
209
191
|
print("\nExiting from main")
|
210
|
-
if compile_server:
|
211
|
-
compile_server.stop()
|
212
192
|
return 1
|
213
193
|
|
214
194
|
sketch_filewatcher = FileWatcherProcess(directory, excluded_patterns=["fastled_js"])
|
@@ -243,6 +223,9 @@ def run_client_server(args: argparse.Namespace) -> int:
|
|
243
223
|
|
244
224
|
try:
|
245
225
|
while True:
|
226
|
+
if shutdown.is_set():
|
227
|
+
print("\nStopping watch mode...")
|
228
|
+
return 0
|
246
229
|
if SpaceBarWatcher.watch_space_bar_pressed(timeout=1.0):
|
247
230
|
print("Compiling...")
|
248
231
|
last_compiled_result = compile_function(last_hash_value=None)
|
@@ -310,3 +293,59 @@ def run_client_server(args: argparse.Namespace) -> int:
|
|
310
293
|
compile_server.stop()
|
311
294
|
if browser_proc:
|
312
295
|
browser_proc.kill()
|
296
|
+
|
297
|
+
|
298
|
+
def run_client_server(args: argparse.Namespace) -> int:
|
299
|
+
profile = bool(args.profile)
|
300
|
+
web: str | bool = args.web if isinstance(args.web, str) else bool(args.web)
|
301
|
+
auto_update = bool(args.auto_update)
|
302
|
+
localhost = bool(args.localhost)
|
303
|
+
directory = Path(args.directory)
|
304
|
+
just_compile = bool(args.just_compile)
|
305
|
+
interactive = bool(args.interactive)
|
306
|
+
force_compile = bool(args.force_compile)
|
307
|
+
open_web_browser = not just_compile and not interactive
|
308
|
+
build_mode: BuildMode = BuildMode.from_args(args)
|
309
|
+
|
310
|
+
if not force_compile and not looks_like_sketch_directory(directory):
|
311
|
+
print(
|
312
|
+
"Error: Not a valid FastLED sketch directory, if you are sure it is, use --force-compile"
|
313
|
+
)
|
314
|
+
return 1
|
315
|
+
|
316
|
+
# If not explicitly using web compiler, check Docker installation
|
317
|
+
if not web and not DockerManager.is_docker_installed():
|
318
|
+
print(
|
319
|
+
"\nDocker is not installed on this system - switching to web compiler instead."
|
320
|
+
)
|
321
|
+
web = True
|
322
|
+
|
323
|
+
url: str
|
324
|
+
compile_server: CompileServer | None = None
|
325
|
+
try:
|
326
|
+
url, compile_server = _try_start_server_or_get_url(auto_update, web, localhost)
|
327
|
+
except KeyboardInterrupt:
|
328
|
+
print("\nExiting from first try...")
|
329
|
+
if compile_server:
|
330
|
+
compile_server.stop()
|
331
|
+
return 1
|
332
|
+
except Exception as e:
|
333
|
+
print(f"Error: {e}")
|
334
|
+
if compile_server:
|
335
|
+
compile_server.stop()
|
336
|
+
return 1
|
337
|
+
|
338
|
+
try:
|
339
|
+
return run_client(
|
340
|
+
directory=directory,
|
341
|
+
host=compile_server if compile_server else url,
|
342
|
+
open_web_browser=open_web_browser,
|
343
|
+
keep_running=not just_compile,
|
344
|
+
build_mode=build_mode,
|
345
|
+
profile=profile,
|
346
|
+
)
|
347
|
+
except KeyboardInterrupt:
|
348
|
+
return 1
|
349
|
+
finally:
|
350
|
+
if compile_server:
|
351
|
+
compile_server.stop()
|
fastled/compile_server.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
from pathlib import Path
|
2
2
|
|
3
|
-
from fastled.types import BuildMode, CompileResult
|
3
|
+
from fastled.types import BuildMode, CompileResult, Platform
|
4
4
|
|
5
5
|
|
6
6
|
class CompileServer:
|
@@ -13,11 +13,14 @@ class CompileServer:
|
|
13
13
|
mapped_dir: Path | None = None,
|
14
14
|
auto_start: bool = True,
|
15
15
|
container_name: str | None = None,
|
16
|
+
platform: Platform = Platform.WASM,
|
16
17
|
) -> None:
|
17
18
|
from fastled.compile_server_impl import ( # avoid circular import
|
18
19
|
CompileServerImpl,
|
19
20
|
)
|
20
21
|
|
22
|
+
assert platform == Platform.WASM, "Only WASM platform is supported right now."
|
23
|
+
|
21
24
|
self.impl = CompileServerImpl(
|
22
25
|
container_name=container_name,
|
23
26
|
interactive=interactive,
|
fastled/live_client.py
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
import threading
|
2
|
+
from pathlib import Path
|
3
|
+
|
4
|
+
from fastled.compile_server import CompileServer
|
5
|
+
from fastled.types import BuildMode
|
6
|
+
|
7
|
+
|
8
|
+
class LiveClient:
|
9
|
+
"""LiveClient class watches for changes and auto-triggeres rebuild."""
|
10
|
+
|
11
|
+
def __init__(
|
12
|
+
self,
|
13
|
+
sketch_directory: Path,
|
14
|
+
host: str | CompileServer | None = None,
|
15
|
+
auto_start: bool = True,
|
16
|
+
open_web_browser: bool = True,
|
17
|
+
keep_running: bool = True,
|
18
|
+
build_mode: BuildMode = BuildMode.QUICK,
|
19
|
+
profile: bool = False,
|
20
|
+
) -> None:
|
21
|
+
self.sketch_directory = sketch_directory
|
22
|
+
self.host = host
|
23
|
+
self.open_web_browser = open_web_browser
|
24
|
+
self.keep_running = keep_running
|
25
|
+
self.build_mode = build_mode
|
26
|
+
self.profile = profile
|
27
|
+
self.auto_start = auto_start
|
28
|
+
self.shutdown = threading.Event()
|
29
|
+
self.thread: threading.Thread | None = None
|
30
|
+
if auto_start:
|
31
|
+
self.start()
|
32
|
+
|
33
|
+
def run(self) -> int:
|
34
|
+
"""Run the client."""
|
35
|
+
from fastled.client_server import run_client # avoid circular import
|
36
|
+
|
37
|
+
rtn = run_client(
|
38
|
+
directory=self.sketch_directory,
|
39
|
+
host=self.host,
|
40
|
+
open_web_browser=self.open_web_browser,
|
41
|
+
keep_running=self.keep_running,
|
42
|
+
build_mode=self.build_mode,
|
43
|
+
profile=self.profile,
|
44
|
+
shutdown=self.shutdown,
|
45
|
+
)
|
46
|
+
return rtn
|
47
|
+
|
48
|
+
@property
|
49
|
+
def running(self) -> bool:
|
50
|
+
return self.thread is not None and self.thread.is_alive()
|
51
|
+
|
52
|
+
def start(self) -> None:
|
53
|
+
"""Start the client."""
|
54
|
+
assert not self.running, "LiveClient is already running"
|
55
|
+
self.shutdown.clear()
|
56
|
+
self.thread = threading.Thread(target=self.run, daemon=True)
|
57
|
+
self.thread.start()
|
58
|
+
|
59
|
+
def stop(self) -> None:
|
60
|
+
"""Stop the client."""
|
61
|
+
self.shutdown.set()
|
62
|
+
if self.thread:
|
63
|
+
self.thread.join()
|
64
|
+
self.thread = None
|
65
|
+
|
66
|
+
def finalize(self) -> None:
|
67
|
+
"""Finalize the client."""
|
68
|
+
self.stop()
|
69
|
+
self.thread = None
|
fastled/parse_args.py
CHANGED
@@ -19,7 +19,7 @@ def parse_args() -> argparse.Namespace:
|
|
19
19
|
"""Parse command-line arguments."""
|
20
20
|
parser = argparse.ArgumentParser(description=f"FastLED WASM Compiler {__version__}")
|
21
21
|
parser.add_argument(
|
22
|
-
"--version", action="version", version=f"
|
22
|
+
"--version", action="version", version=f"{__version__}"
|
23
23
|
)
|
24
24
|
parser.add_argument(
|
25
25
|
"directory",
|
fastled/project_init.py
CHANGED
@@ -13,7 +13,8 @@ DEFAULT_EXAMPLE = "wasm"
|
|
13
13
|
def get_examples() -> list[str]:
|
14
14
|
response = httpx.get(ENDPOINT_INFO, timeout=4)
|
15
15
|
response.raise_for_status()
|
16
|
-
|
16
|
+
out: list[str] = response.json()["examples"]
|
17
|
+
return sorted(out)
|
17
18
|
|
18
19
|
|
19
20
|
def _prompt_for_example() -> str:
|
@@ -62,7 +63,9 @@ def project_init(
|
|
62
63
|
with zipfile.ZipFile(tmpzip, "r") as zip_ref:
|
63
64
|
zip_ref.extractall(outputdir)
|
64
65
|
tmpzip.unlink()
|
65
|
-
|
66
|
+
out = outputdir / example
|
67
|
+
assert out.exists()
|
68
|
+
return out
|
66
69
|
|
67
70
|
|
68
71
|
def unit_test() -> None:
|
fastled/types.py
CHANGED
@@ -45,3 +45,17 @@ class BuildMode(Enum):
|
|
45
45
|
return BuildMode.RELEASE
|
46
46
|
else:
|
47
47
|
return BuildMode.QUICK
|
48
|
+
|
49
|
+
|
50
|
+
class Platform(Enum):
|
51
|
+
WASM = "WASM"
|
52
|
+
|
53
|
+
@classmethod
|
54
|
+
def from_string(cls, platform_str: str) -> "Platform":
|
55
|
+
try:
|
56
|
+
return cls[platform_str.upper()]
|
57
|
+
except KeyError:
|
58
|
+
valid_modes = [mode.name for mode in cls]
|
59
|
+
raise ValueError(
|
60
|
+
f"Platform must be one of {valid_modes}, got {platform_str}"
|
61
|
+
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: fastled
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.1.41
|
4
4
|
Summary: FastLED Wasm Compiler
|
5
5
|
Home-page: https://github.com/zackees/fastled-wasm
|
6
6
|
Maintainer: Zachary Vorhies
|
@@ -27,11 +27,14 @@ Compiles an Arduino/Platformio sketch into a wasm binary that can be run directl
|
|
27
27
|
|
28
28
|
|
29
29
|
[](https://github.com/zackees/fastled-wasm/actions/workflows/lint.yml)
|
30
|
-
[](https://github.com/zackees/fastled-wasm/actions/workflows/build_multi_docker_image.yml)
|
31
30
|
[](https://github.com/zackees/fastled-wasm/actions/workflows/test_macos.yml)
|
32
31
|
[](https://github.com/zackees/fastled-wasm/actions/workflows/test_ubuntu.yml)
|
33
32
|
[](https://github.com/zackees/fastled-wasm/actions/workflows/test_win.yml)
|
34
33
|
|
34
|
+
[](https://github.com/zackees/fastled-wasm/actions/workflows/build_multi_docker_image.yml)
|
35
|
+
[](https://github.com/zackees/fastled-wasm/actions/workflows/test_build_exe.yml)
|
36
|
+
[](https://github.com/zackees/fastled-wasm/actions/workflows/create_version_tag.yml)
|
37
|
+
[](https://github.com/zackees/fastled-wasm/actions/workflows/build_release.yml)
|
35
38
|
|
36
39
|
|
37
40
|
# About
|
@@ -148,6 +151,35 @@ with Api.server() as server:
|
|
148
151
|
|
149
152
|
```
|
150
153
|
|
154
|
+
**LiveClient will auto-trigger a build on code changes, just like the cli does**
|
155
|
+
```python
|
156
|
+
|
157
|
+
# Live Client will compile against the web-compiler
|
158
|
+
from fastapi import Api, LiveClient
|
159
|
+
client: LiveClient = Api.live_client(
|
160
|
+
"path/to/sketch_directory",
|
161
|
+
)
|
162
|
+
# Now user can start editing their sketch and it will auto-compile
|
163
|
+
# ... after a while stop it like this.
|
164
|
+
client.stop()
|
165
|
+
```
|
166
|
+
|
167
|
+
**LiveClient with local CompileServer**
|
168
|
+
```python
|
169
|
+
|
170
|
+
# Live Client will compile against a local server.
|
171
|
+
from fastapi import Api, LiveClient
|
172
|
+
|
173
|
+
with Api.server() as server:
|
174
|
+
client: LiveClient = Api.live_client(
|
175
|
+
"path/to/sketch_directory",
|
176
|
+
host=server
|
177
|
+
)
|
178
|
+
# Now user can start editing their sketch and it will auto-compile
|
179
|
+
# ... after a while stop it like this.
|
180
|
+
client.stop()
|
181
|
+
```
|
182
|
+
|
151
183
|
# Features
|
152
184
|
|
153
185
|
## Hot reload by default
|
@@ -168,11 +200,15 @@ can be much longer, for example if you modify a header file.
|
|
168
200
|
Huge blobs of data like video will absolutely kill the compile performance as these blobs would normally have to be shuffled
|
169
201
|
back and forth. Therefore a special directory `data/` is implicitly used to hold this blob data. Any data in this directory
|
170
202
|
will be replaced with a stub containing the size and hash of the file during upload. On download these stubs are swapped back
|
171
|
-
with their originals.
|
203
|
+
with their originals during decompression.
|
172
204
|
|
173
205
|
The wasm compiler will recognize all files in the `data/` directory and generate a `files.json` manifest and can be used
|
174
206
|
in your wasm sketch using an emulated SD card system mounted at `/data/` on the SD Card. In order to increase load speed, these
|
175
|
-
files will be asynchroniously streamed into the running sketch instance during runtime.
|
207
|
+
files will be asynchroniously streamed into the running sketch instance during runtime. Files named with *.json, *.csv, *.txt will be
|
208
|
+
immediately injected in the app before setup() is called and can be used immediatly in setup() in their entirety.
|
209
|
+
|
210
|
+
All other files will be streamed in. The `Video` element in FastLED is designed to gracefully handle missing data streamed in through
|
211
|
+
the file system.
|
176
212
|
|
177
213
|
For an example of how to use this see `examples/SdCard` which is fully wasm compatible.
|
178
214
|
|
@@ -184,11 +220,9 @@ We use `ccache` to cache object files. This seems actually help a lot and is bet
|
|
184
220
|
|
185
221
|
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.
|
186
222
|
|
187
|
-
Simple syntax errors will be caught by the pre-processing step. This happens without a lock to reduce the single lock bottleneck.
|
188
|
-
|
189
223
|
## Sketch Cache
|
190
224
|
|
191
|
-
Sketchs are
|
225
|
+
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
|
192
226
|
printing while the actual source files are sent to compiler to preserve line numbers and file names.
|
193
227
|
|
194
228
|
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.
|
@@ -223,8 +257,12 @@ A: `delay()` will block `loop()` which blocks the main thread of the browser. Th
|
|
223
257
|
Q: How can I get the compiled size of my FastLED sketch smaller?
|
224
258
|
A: A big chunk of space is being used by unnecessary javascript `emscripten` is bundling. This can be tweeked by the wasm_compiler_settings.py file in the FastLED repo.
|
225
259
|
|
260
|
+
|
226
261
|
# Revisions
|
227
262
|
|
263
|
+
* 1.1.41 - Platform executable (through pyinstaller) now enabled.
|
264
|
+
* 1.1.40 - Remove `sketch_directory` from Api object. This was only needed before we had a client/server architecture.
|
265
|
+
* 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.
|
228
266
|
* 1.1.38 - Cleanup the `fastled.Api` object and streamline for general use.
|
229
267
|
* 1.1.37 - `Test.test_examples()` is now unit tested to work correctly.
|
230
268
|
* 1.1.36 - We now have an api. `from fastled import Api` and `from fastled import Test` for testing.
|
@@ -1,29 +1,30 @@
|
|
1
|
-
fastled/__init__.py,sha256=
|
1
|
+
fastled/__init__.py,sha256=kwgkMY8IWYQewAXh7xB4lYPy7P3M4IZNazRdPvIpTp8,3462
|
2
2
|
fastled/app.py,sha256=3xg7oVD-UYnKPU8SAY-Cs5UnAYdwpdpuEFRR2N8P1Tg,1787
|
3
3
|
fastled/cli.py,sha256=CNR_pQR0sNVPNuv8e_nmm-0PI8sU-eUBUgnWgWkzW9c,237
|
4
|
-
fastled/client_server.py,sha256=
|
5
|
-
fastled/compile_server.py,sha256=
|
4
|
+
fastled/client_server.py,sha256=MGE4rg40EA2ty6nKExVxkjUbPbif1Bbx0vDjwNcDOD8,12563
|
5
|
+
fastled/compile_server.py,sha256=Z7rHFs3M6QPbSCsbgHAQDk6GTVAJMMPCXtD4Y0mu8RM,2659
|
6
6
|
fastled/compile_server_impl.py,sha256=ClBLtFHB0ucaT8tAJfI6o3bJ-LRnXc4Pxy7bVKnFiww,8803
|
7
7
|
fastled/docker_manager.py,sha256=zBCFGk2P3_bS7_SUQ5j2lpsOS3RvIzXYkrJXC6xP69k,25383
|
8
8
|
fastled/filewatcher.py,sha256=LwEQJkqADsArZyY499RLAer6JjJyDwaQBcAvT7xmp3c,6708
|
9
9
|
fastled/keyboard.py,sha256=Zz_ggxOUTX2XQEy6K6kAoorVlUev4wEk9Awpvv9aStA,3241
|
10
|
+
fastled/live_client.py,sha256=_KvqmyUyyGpoYET1Z9CdeUVoIbFjIUWwPcTp5XCQuxY,2075
|
10
11
|
fastled/open_browser.py,sha256=vzMBcpDNY0f-Bx9KmEILKDANZ6gvsywCVwn1FRhPXh4,1770
|
11
|
-
fastled/parse_args.py,sha256=
|
12
|
+
fastled/parse_args.py,sha256=FKLucZPQoprln1U_L9ZhigLmoUwyGjN5U53LtIJ-rxQ,6141
|
12
13
|
fastled/paths.py,sha256=VsPmgu0lNSCFOoEC0BsTYzDygXqy15AHUfN-tTuzDZA,99
|
13
|
-
fastled/project_init.py,sha256=
|
14
|
+
fastled/project_init.py,sha256=We-fVf4FqFcXhKUqjWnhV1HXmfXbo-1nCBMJ_TCip2U,2177
|
14
15
|
fastled/select_sketch_directory.py,sha256=TZdCjl1D7YMKjodMTvDRurPcpAmN3x0TcJxffER2NfM,1314
|
15
16
|
fastled/settings.py,sha256=3eMKv0tLXgIQ0CFDboIp_l5_71rzIIyWg353YjnYJnc,323
|
16
17
|
fastled/sketch.py,sha256=483TrrIdZJfo1MIu5FkD-V5OGmOfHmsZ2f6VvNsJBJM,3299
|
17
18
|
fastled/spinner.py,sha256=VHxmvB92P0Z_zYxRajb5HiNmkHHvZ5dG7hKtZltzpcs,867
|
18
19
|
fastled/string_diff.py,sha256=UR1oRhg9lsPzAG4bn_MwJMCn0evP5AigkBiwLiI9fgA,1354
|
19
|
-
fastled/types.py,sha256=
|
20
|
+
fastled/types.py,sha256=PpSEtzFCkWtSIEMC0QXGl966R97vLoryVl3yFW0YhTs,1475
|
20
21
|
fastled/util.py,sha256=t4M3NFMhnCzfYbLvIyJi0RdFssZqbTN_vVIaej1WV-U,265
|
21
22
|
fastled/web_compile.py,sha256=05PeLJ77QQC6PUKjDhsntBmyBola6QQIfF2k-zjYNE4,10261
|
22
23
|
fastled/assets/example.txt,sha256=lTBovRjiz0_TgtAtbA1C5hNi2ffbqnNPqkKg6UiKCT8,54
|
23
24
|
fastled/test/examples.py,sha256=EDXb6KastKOOWzew99zrpmcNcXTcAtYi8eud6F1pnWA,980
|
24
|
-
fastled-1.1.
|
25
|
-
fastled-1.1.
|
26
|
-
fastled-1.1.
|
27
|
-
fastled-1.1.
|
28
|
-
fastled-1.1.
|
29
|
-
fastled-1.1.
|
25
|
+
fastled-1.1.41.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
|
26
|
+
fastled-1.1.41.dist-info/METADATA,sha256=IvguecOLyldh781GONmBvWZNB_7WfgJ0MQTTqjAK7so,18667
|
27
|
+
fastled-1.1.41.dist-info/WHEEL,sha256=pxeNX5JdtCe58PUSYP9upmc7jdRPgvT0Gm9kb1SHlVw,109
|
28
|
+
fastled-1.1.41.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
|
29
|
+
fastled-1.1.41.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
|
30
|
+
fastled-1.1.41.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|