fastled 1.3.16__py3-none-any.whl → 1.3.18__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/__version__.py +1 -1
- fastled/docker_manager.py +2 -2
- fastled/print_filter.py +0 -195
- fastled/server_flask.py +6 -1
- fastled/types.py +2 -2
- fastled/util.py +6 -3
- {fastled-1.3.16.dist-info → fastled-1.3.18.dist-info}/METADATA +2 -1
- {fastled-1.3.16.dist-info → fastled-1.3.18.dist-info}/RECORD +12 -12
- {fastled-1.3.16.dist-info → fastled-1.3.18.dist-info}/WHEEL +0 -0
- {fastled-1.3.16.dist-info → fastled-1.3.18.dist-info}/entry_points.txt +0 -0
- {fastled-1.3.16.dist-info → fastled-1.3.18.dist-info}/licenses/LICENSE +0 -0
- {fastled-1.3.16.dist-info → fastled-1.3.18.dist-info}/top_level.txt +0 -0
fastled/__version__.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# IMPORTANT! There's a bug in github which will REJECT any version update
|
2
2
|
# that has any other change in the repo. Please bump the version as the
|
3
3
|
# ONLY change in a commit, or else the pypi update and the release will fail.
|
4
|
-
__version__ = "1.3.
|
4
|
+
__version__ = "1.3.18"
|
5
5
|
|
6
6
|
__version_url_latest__ = "https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/src/fastled/__version__.py"
|
fastled/docker_manager.py
CHANGED
@@ -25,7 +25,7 @@ from docker.models.containers import Container
|
|
25
25
|
from docker.models.images import Image
|
26
26
|
from filelock import FileLock
|
27
27
|
|
28
|
-
from fastled.print_filter import PrintFilter,
|
28
|
+
from fastled.print_filter import PrintFilter, PrintFilterDefault
|
29
29
|
from fastled.spinner import Spinner
|
30
30
|
|
31
31
|
CONFIG_DIR = Path(user_data_dir("fastled", "fastled"))
|
@@ -138,7 +138,7 @@ class Volume:
|
|
138
138
|
# Override the default PrintFilter to use a custom one.
|
139
139
|
def make_default_print_filter() -> PrintFilter:
|
140
140
|
"""Create a default PrintFilter instance."""
|
141
|
-
return
|
141
|
+
return PrintFilterDefault()
|
142
142
|
|
143
143
|
|
144
144
|
class RunningContainer:
|
fastled/print_filter.py
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
import re
|
2
|
-
import zlib
|
3
2
|
from abc import ABC, abstractmethod
|
4
|
-
from dataclasses import dataclass
|
5
3
|
from enum import Enum
|
6
4
|
|
7
5
|
|
@@ -42,10 +40,6 @@ def _handle_ino_cpp(line: str) -> str:
|
|
42
40
|
return line
|
43
41
|
|
44
42
|
|
45
|
-
def _handle_fastled_src(line: str) -> str:
|
46
|
-
return line.replace("fastled/src", "src")
|
47
|
-
|
48
|
-
|
49
43
|
class PrintFilterDefault(PrintFilter):
|
50
44
|
"""Provides default filtering for FastLED output."""
|
51
45
|
|
@@ -53,195 +47,6 @@ class PrintFilterDefault(PrintFilter):
|
|
53
47
|
return text
|
54
48
|
|
55
49
|
|
56
|
-
class PrintFilterFastled(PrintFilter):
|
57
|
-
"""Provides filtering for FastLED output so that source files match up with local names."""
|
58
|
-
|
59
|
-
def __init__(self, echo: bool = True) -> None:
|
60
|
-
super().__init__(echo)
|
61
|
-
self.build_started = False
|
62
|
-
# self.compile_link_active = False
|
63
|
-
# self.compile_link_filter:
|
64
|
-
|
65
|
-
def filter(self, text: str) -> str:
|
66
|
-
lines = text.splitlines()
|
67
|
-
out: list[str] = []
|
68
|
-
for line in lines:
|
69
|
-
## DEBUG DO NOT SUBMIT
|
70
|
-
# print(line)
|
71
|
-
if "# WASM is building" in line:
|
72
|
-
self.build_started = True
|
73
|
-
line = _handle_fastled_src(
|
74
|
-
line
|
75
|
-
) # Always convert fastled/src to src for file matchups.
|
76
|
-
if self.build_started or " error: " in line:
|
77
|
-
line = _handle_ino_cpp(line)
|
78
|
-
out.append(line)
|
79
|
-
text = "\n".join(out)
|
80
|
-
return text
|
81
|
-
|
82
|
-
|
83
50
|
class CompileOrLink(Enum):
|
84
51
|
COMPILE = "compile"
|
85
52
|
LINK = "link"
|
86
|
-
|
87
|
-
|
88
|
-
@dataclass
|
89
|
-
class BuildArtifact:
|
90
|
-
timestamp: float
|
91
|
-
input_artifact: str | None
|
92
|
-
output_artifact: str | None
|
93
|
-
build_flags: str
|
94
|
-
compile_or_link: CompileOrLink
|
95
|
-
hash: int
|
96
|
-
|
97
|
-
def flags_pretty(self) -> str:
|
98
|
-
"""
|
99
|
-
Returns the flags in a pretty format.
|
100
|
-
This is used for printing the flags to the console.
|
101
|
-
"""
|
102
|
-
flags = self.build_flags
|
103
|
-
flags = flags.replace(" -I", "\n-I")
|
104
|
-
flags = flags.replace(" -D", "\n-D")
|
105
|
-
flags = flags.replace(" -l", "\n-l")
|
106
|
-
flags = flags.replace(" -L", "\n-L")
|
107
|
-
flags = flags.replace(" -o", "\n-o")
|
108
|
-
flags = flags.replace(" -W", "\n-W")
|
109
|
-
flags = flags.replace(" -f", "\n-f")
|
110
|
-
flags = flags.replace(" -g", "\n-g")
|
111
|
-
|
112
|
-
# break into lines and sort
|
113
|
-
lines = flags.splitlines()
|
114
|
-
first_line = lines[0]
|
115
|
-
lines.pop(0) # remove first line
|
116
|
-
lines = sorted(lines)
|
117
|
-
# remove duplicates
|
118
|
-
lines = list(dict.fromkeys(lines))
|
119
|
-
# remove empty lines
|
120
|
-
lines = [line for line in lines if line.strip() != ""]
|
121
|
-
# remove leading and trailing whitespace
|
122
|
-
lines = [line.strip() for line in lines]
|
123
|
-
lines = sorted(lines)
|
124
|
-
lines = [first_line] + lines # add first line back to the beginning
|
125
|
-
# stringify
|
126
|
-
flags = "\n".join(lines)
|
127
|
-
return flags
|
128
|
-
|
129
|
-
def __str__(self) -> str:
|
130
|
-
return f"{self.brief()} {self.build_flags} {self.compile_or_link} {self.hash}"
|
131
|
-
|
132
|
-
def brief(self) -> str:
|
133
|
-
return f"{self.timestamp:.2f} {self.output_artifact}"
|
134
|
-
|
135
|
-
def begin_flags(self) -> str:
|
136
|
-
"""
|
137
|
-
Returns the flags that are used to begin a build.
|
138
|
-
This is the flags that are used for the first compile or link.
|
139
|
-
"""
|
140
|
-
|
141
|
-
out: str = (
|
142
|
-
"\n################ NEW COMPILE/LINK FLAG GROUP #####################\n\n"
|
143
|
-
)
|
144
|
-
out += f"{self.flags_pretty()}\n"
|
145
|
-
return out
|
146
|
-
|
147
|
-
def end_flags(self) -> str:
|
148
|
-
"""
|
149
|
-
Returns the flags that are used to end a build.
|
150
|
-
This is the flags that are used for the last compile or link.
|
151
|
-
"""
|
152
|
-
out: str = (
|
153
|
-
"\n################ END COMPILE/LINK FLAG GROUP #####################\n"
|
154
|
-
)
|
155
|
-
return out
|
156
|
-
|
157
|
-
@staticmethod
|
158
|
-
def parse(input_str: str) -> "BuildArtifact | None":
|
159
|
-
"""
|
160
|
-
Parse a single build-log line of the form:
|
161
|
-
"<timestamp> ... <some .cpp or .h file> ... <flags>"
|
162
|
-
|
163
|
-
Returns a BuildArtifact, or None if parsing failed.
|
164
|
-
"""
|
165
|
-
return _parse(input_str)
|
166
|
-
|
167
|
-
|
168
|
-
class TokenFilter(ABC):
|
169
|
-
@abstractmethod
|
170
|
-
def extract(self, tokens: list[str]) -> str | None:
|
171
|
-
"""
|
172
|
-
Scan `tokens`, remove any tokens this filter is responsible for,
|
173
|
-
and return the extracted string (or None if not found/invalid).
|
174
|
-
"""
|
175
|
-
...
|
176
|
-
|
177
|
-
|
178
|
-
class TimestampFilter(TokenFilter):
|
179
|
-
def extract(self, tokens: list[str]) -> str | None:
|
180
|
-
if not tokens:
|
181
|
-
return None
|
182
|
-
candidate = tokens[0]
|
183
|
-
try:
|
184
|
-
_ = float(candidate)
|
185
|
-
return tokens.pop(0)
|
186
|
-
except ValueError:
|
187
|
-
return None
|
188
|
-
|
189
|
-
|
190
|
-
class InputArtifactFilter(TokenFilter):
|
191
|
-
def extract(self, tokens: list[str]) -> str | None:
|
192
|
-
for i, tok in enumerate(tokens):
|
193
|
-
if tok.endswith(".cpp") or tok.endswith(".h"):
|
194
|
-
return tokens.pop(i)
|
195
|
-
return None
|
196
|
-
|
197
|
-
|
198
|
-
class OutputArtifactFilter(TokenFilter):
|
199
|
-
def extract(self, tokens: list[str]) -> str | None:
|
200
|
-
for i, tok in enumerate(tokens):
|
201
|
-
if tok == "-o" and i + 1 < len(tokens):
|
202
|
-
tokens.pop(i) # drop '-o'
|
203
|
-
return tokens.pop(i) # drop & return artifact
|
204
|
-
return None
|
205
|
-
|
206
|
-
|
207
|
-
class ActionFilter(TokenFilter):
|
208
|
-
def extract(self, tokens: list[str]) -> str | None:
|
209
|
-
if "-c" in tokens:
|
210
|
-
return CompileOrLink.COMPILE.value
|
211
|
-
return CompileOrLink.LINK.value
|
212
|
-
|
213
|
-
|
214
|
-
def _parse(line: str) -> BuildArtifact | None:
|
215
|
-
tokens = line.strip().split()
|
216
|
-
if not tokens:
|
217
|
-
return None
|
218
|
-
|
219
|
-
# instantiate in the order we need them
|
220
|
-
filters: list[TokenFilter] = [
|
221
|
-
TimestampFilter(),
|
222
|
-
InputArtifactFilter(),
|
223
|
-
OutputArtifactFilter(),
|
224
|
-
ActionFilter(),
|
225
|
-
]
|
226
|
-
|
227
|
-
# apply each filter
|
228
|
-
raw_ts = filters[0].extract(tokens)
|
229
|
-
raw_in = filters[1].extract(tokens)
|
230
|
-
raw_out = filters[2].extract(tokens)
|
231
|
-
raw_act = filters[3].extract(tokens)
|
232
|
-
|
233
|
-
if raw_ts is None or raw_in is None or raw_act is None:
|
234
|
-
return None
|
235
|
-
|
236
|
-
# the rest of `tokens` are the flags
|
237
|
-
flags_str = " ".join(tokens)
|
238
|
-
h = zlib.adler32(flags_str.encode("utf-8"))
|
239
|
-
|
240
|
-
return BuildArtifact(
|
241
|
-
timestamp=float(raw_ts),
|
242
|
-
input_artifact=raw_in,
|
243
|
-
output_artifact=raw_out,
|
244
|
-
build_flags=flags_str,
|
245
|
-
compile_or_link=CompileOrLink(raw_act),
|
246
|
-
hash=h,
|
247
|
-
)
|
fastled/server_flask.py
CHANGED
@@ -28,11 +28,15 @@ else:
|
|
28
28
|
|
29
29
|
def _is_dwarf_source(path: str) -> bool:
|
30
30
|
"""Check if the path is a dwarf source file."""
|
31
|
+
if "dwarfsource" in path:
|
32
|
+
logger.debug(f"Path '{path}' contains 'dwarfsource'")
|
33
|
+
return True
|
31
34
|
# Check if the path starts with "fastledsource/" or "sketchsource/"
|
32
35
|
return (
|
33
36
|
path.startswith("fastledsource/")
|
34
37
|
or path.startswith("sketchsource/")
|
35
|
-
or path.startswith("dwarfsource")
|
38
|
+
or path.startswith("/dwarfsource/")
|
39
|
+
or path.startswith("dwarfsource/")
|
36
40
|
)
|
37
41
|
|
38
42
|
|
@@ -335,6 +339,7 @@ def _run_flask_server(
|
|
335
339
|
|
336
340
|
try:
|
337
341
|
is_debug_src_code_request = _is_dwarf_source(path)
|
342
|
+
logger.info(f"is debug_src_code_request: {is_debug_src_code_request}")
|
338
343
|
if is_debug_src_code_request:
|
339
344
|
logger.info(f"Handling as drawfsource: {path}")
|
340
345
|
return handle_fastledsource(path)
|
fastled/types.py
CHANGED
@@ -3,7 +3,7 @@ from enum import Enum
|
|
3
3
|
from typing import Any
|
4
4
|
|
5
5
|
from fastled.args import Args
|
6
|
-
from fastled.print_filter import
|
6
|
+
from fastled.print_filter import PrintFilterDefault
|
7
7
|
|
8
8
|
|
9
9
|
@dataclass
|
@@ -21,7 +21,7 @@ class CompileResult:
|
|
21
21
|
|
22
22
|
def __post_init__(self):
|
23
23
|
# Filter the stdout.
|
24
|
-
pf =
|
24
|
+
pf = PrintFilterDefault(echo=False)
|
25
25
|
self.stdout = pf.print(self.stdout)
|
26
26
|
|
27
27
|
|
fastled/util.py
CHANGED
@@ -14,9 +14,12 @@ def banner_string(msg: str) -> str:
|
|
14
14
|
lines = msg.splitlines()
|
15
15
|
max_length = max(len(line) for line in lines)
|
16
16
|
border = "#" * (max_length + 4)
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
out: list[str] = []
|
18
|
+
out.append(border)
|
19
|
+
for line in lines:
|
20
|
+
out.append(f"# {line} " + " " * (max_length - len(line)) + "#")
|
21
|
+
out.append(border)
|
22
|
+
return "\n".join(out)
|
20
23
|
|
21
24
|
|
22
25
|
def print_banner(msg: str) -> None:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: fastled
|
3
|
-
Version: 1.3.
|
3
|
+
Version: 1.3.18
|
4
4
|
Summary: FastLED Wasm Compiler
|
5
5
|
Home-page: https://github.com/zackees/fastled-wasm
|
6
6
|
Maintainer: Zachary Vorhies
|
@@ -403,6 +403,7 @@ A: A big chunk of space is being used by unnecessary javascript `emscripten` bun
|
|
403
403
|
|
404
404
|
## Performance
|
405
405
|
|
406
|
+
|
406
407
|
```
|
407
408
|
###############################
|
408
409
|
# Build started with command: #
|
@@ -1,5 +1,5 @@
|
|
1
1
|
fastled/__init__.py,sha256=YLikXGRWKlKAqj7bpvGmJLejGTFF-FC1lv2z1jwRinA,6852
|
2
|
-
fastled/__version__.py,sha256=
|
2
|
+
fastled/__version__.py,sha256=xOnLQ6nJRZl-sf5g9Q1GzHGIQKsW6TRkHt8l0wnChY0,373
|
3
3
|
fastled/app.py,sha256=zfSipnCZ6w9_aXCynGrqf7OE--mKzbhT0mEfCNW5XjA,5736
|
4
4
|
fastled/args.py,sha256=d9CaarQ1yw7w0REwgrNQ78zOUQSk94fTXwXHtFZPTSY,3281
|
5
5
|
fastled/cli.py,sha256=drgR2AOxVrj3QEz58iiKscYAumbbin2vIV-k91VCOAA,561
|
@@ -8,7 +8,7 @@ fastled/cli_test_interactive.py,sha256=BjNhveZOk5aCffHbcrxPQQjWmAuj4ClVKKcKX5eY6
|
|
8
8
|
fastled/client_server.py,sha256=uK-reqTN4umtVm8K3fcLo2Op_P_jFKVFtKFJRpBF1Xs,18598
|
9
9
|
fastled/compile_server.py,sha256=rkXvrvdav5vDG8lv_OlBX3YSCHtnHMt25nXbfeg_r78,2960
|
10
10
|
fastled/compile_server_impl.py,sha256=S9jaAMgaprrjW9oF0J4_H-QJc6OeNRmoFCt07RsXTkI,11644
|
11
|
-
fastled/docker_manager.py,sha256=
|
11
|
+
fastled/docker_manager.py,sha256=RzXeTyGTtzeAclUkk_RPk_eksUSjOOgPND3Mehu5zRs,40232
|
12
12
|
fastled/filewatcher.py,sha256=3qS3L7zMQhFuVrkeGn1djsB_cB6x_E2YGJmmQWVAU_w,10033
|
13
13
|
fastled/keyboard.py,sha256=UTAsqCn1UMYnB8YDzENiLTj4GeL45tYfEcO7_5fLFEg,3556
|
14
14
|
fastled/keyz.py,sha256=LO-8m_7CpNDiZLM-FXhQ30f9gN1bUYz5lOsUPTIbI-c,4020
|
@@ -16,17 +16,17 @@ fastled/live_client.py,sha256=yoAul8tVgbbPf1oEC79SUZSHkLECxlrXxgWR9XaBIp4,2957
|
|
16
16
|
fastled/open_browser.py,sha256=DFyMrc1qic4Go7eLNPqMaLuMvTaE73NixdfSKV0yyp8,3709
|
17
17
|
fastled/parse_args.py,sha256=Xj3jbNaTdEemqT1GcuhADvwT1mFX0InSC-Gzicqml1c,10791
|
18
18
|
fastled/paths.py,sha256=VsPmgu0lNSCFOoEC0BsTYzDygXqy15AHUfN-tTuzDZA,99
|
19
|
-
fastled/print_filter.py,sha256=
|
19
|
+
fastled/print_filter.py,sha256=nc_rqYYdCUPinFycaK7fiQF5PG1up51pmJptR__QyAs,1499
|
20
20
|
fastled/project_init.py,sha256=bBt4DwmW5hZkm9ICt9Qk-0Nr_0JQM7icCgH5Iv-bCQs,3984
|
21
21
|
fastled/select_sketch_directory.py,sha256=-eudwCns3AKj4HuHtSkZAFwbnf005SNL07pOzs9VxnE,1383
|
22
|
-
fastled/server_flask.py,sha256=
|
22
|
+
fastled/server_flask.py,sha256=TYb4N169sl5IwSgdvaCQvHyn3ZiX9DNDe6VE9lnlgp0,18515
|
23
23
|
fastled/server_start.py,sha256=W9yKStkRlRNuXeV6j_6O7HjjFPyVLBHMcF9Uy2QjDWQ,479
|
24
24
|
fastled/settings.py,sha256=dUVyJ8Mtprg0RwaS6oMWP8jBhr4C3R8fu4Hdx_Z1lCM,577
|
25
25
|
fastled/sketch.py,sha256=Ftbh55Nt-p4hmPuPpj8Q9HrMzvnUazhoG_q9FHcxkns,3473
|
26
26
|
fastled/spinner.py,sha256=VHxmvB92P0Z_zYxRajb5HiNmkHHvZ5dG7hKtZltzpcs,867
|
27
27
|
fastled/string_diff.py,sha256=NbtYxvBFxTUdmTpMLizlgZj2ULJ-7etj72GBdWDTGws,2496
|
28
|
-
fastled/types.py,sha256=
|
29
|
-
fastled/util.py,sha256=
|
28
|
+
fastled/types.py,sha256=ZDf1TbTT4XgA_pKIwr4JbkDB38_29ogSdDORjoT-zuY,1803
|
29
|
+
fastled/util.py,sha256=TcqK_6ycq46dN9pxvnZEcjSG6qvNJnH9IvSQOqO0z_c,1411
|
30
30
|
fastled/version.py,sha256=TpBMiEVdO3_sUZEu6wmwN8Q4AgX2BiCxStCsnPKh6E0,1209
|
31
31
|
fastled/web_compile.py,sha256=R159Od1VqeXTW6y3rQY0_P9f0CJYbPuBiMLqb-zBCUQ,11526
|
32
32
|
fastled/assets/example.txt,sha256=lTBovRjiz0_TgtAtbA1C5hNi2ffbqnNPqkKg6UiKCT8,54
|
@@ -36,9 +36,9 @@ fastled/site/build.py,sha256=2YKU_UWKlJdGnjdbAbaL0co6kceFMSTVYwH1KCmgPZA,13987
|
|
36
36
|
fastled/site/examples.py,sha256=s6vj2zJc6BfKlnbwXr1QWY1mzuDBMt6j5MEBOWjO_U8,155
|
37
37
|
fastled/test/can_run_local_docker_tests.py,sha256=LEuUbHctRhNNFWcvnz2kEGmjDJeXO4c3kNpizm3yVJs,400
|
38
38
|
fastled/test/examples.py,sha256=GfaHeY1E8izBl6ZqDVjz--RHLyVR4NRnQ5pBesCFJFY,1673
|
39
|
-
fastled-1.3.
|
40
|
-
fastled-1.3.
|
41
|
-
fastled-1.3.
|
42
|
-
fastled-1.3.
|
43
|
-
fastled-1.3.
|
44
|
-
fastled-1.3.
|
39
|
+
fastled-1.3.18.dist-info/licenses/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
|
40
|
+
fastled-1.3.18.dist-info/METADATA,sha256=HX7ofZYqP4xfEC8xAgUwJmJwTtCo4icgE7shmpAdvTc,30045
|
41
|
+
fastled-1.3.18.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
42
|
+
fastled-1.3.18.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
|
43
|
+
fastled-1.3.18.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
|
44
|
+
fastled-1.3.18.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|