fastled 1.3.5__py3-none-any.whl → 1.3.10__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/app.py +2 -1
- fastled/args.py +90 -0
- fastled/client_server.py +12 -6
- fastled/docker_manager.py +7 -0
- fastled/parse_args.py +1 -1
- fastled/types.py +1 -88
- {fastled-1.3.5.dist-info → fastled-1.3.10.dist-info}/METADATA +1 -1
- {fastled-1.3.5.dist-info → fastled-1.3.10.dist-info}/RECORD +13 -12
- {fastled-1.3.5.dist-info → fastled-1.3.10.dist-info}/WHEEL +0 -0
- {fastled-1.3.5.dist-info → fastled-1.3.10.dist-info}/entry_points.txt +0 -0
- {fastled-1.3.5.dist-info → fastled-1.3.10.dist-info}/licenses/LICENSE +0 -0
- {fastled-1.3.5.dist-info → fastled-1.3.10.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.10"
|
5
5
|
|
6
6
|
__version_url_latest__ = "https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/src/fastled/__version__.py"
|
fastled/app.py
CHANGED
@@ -31,6 +31,7 @@ def run_server(args: Args) -> int:
|
|
31
31
|
auto_updates=auto_update,
|
32
32
|
mapped_dir=mapped_dir,
|
33
33
|
auto_start=True,
|
34
|
+
remove_previous=args.clear,
|
34
35
|
)
|
35
36
|
|
36
37
|
if not interactive:
|
@@ -112,7 +113,7 @@ def main() -> int:
|
|
112
113
|
auto_updates=False,
|
113
114
|
mapped_dir=directory,
|
114
115
|
auto_start=False,
|
115
|
-
remove_previous=
|
116
|
+
remove_previous=args.clear,
|
116
117
|
)
|
117
118
|
|
118
119
|
server.start(wait_for_startup=False)
|
fastled/args.py
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
import argparse
|
2
|
+
from dataclasses import dataclass
|
3
|
+
from pathlib import Path
|
4
|
+
|
5
|
+
|
6
|
+
@dataclass
|
7
|
+
class Args:
|
8
|
+
directory: Path | None
|
9
|
+
init: bool | str
|
10
|
+
just_compile: bool
|
11
|
+
web: str | None
|
12
|
+
interactive: bool
|
13
|
+
profile: bool
|
14
|
+
force_compile: bool
|
15
|
+
auto_update: bool | None
|
16
|
+
update: bool
|
17
|
+
localhost: bool
|
18
|
+
build: bool
|
19
|
+
server: bool
|
20
|
+
purge: bool
|
21
|
+
debug: bool
|
22
|
+
quick: bool
|
23
|
+
release: bool
|
24
|
+
ram_disk_size: str # suffixed liked "25mb" or "1gb"
|
25
|
+
clear = False # Force the last running container to be removed. Useful for benchmarking.
|
26
|
+
|
27
|
+
@staticmethod
|
28
|
+
def from_namespace(args: argparse.Namespace) -> "Args":
|
29
|
+
assert isinstance(
|
30
|
+
args.directory, str | None
|
31
|
+
), f"expected str | None, got {type(args.directory)}"
|
32
|
+
assert isinstance(
|
33
|
+
args.init, bool | str | None
|
34
|
+
), f"expected bool, got {type(args.init)}"
|
35
|
+
assert isinstance(
|
36
|
+
args.just_compile, bool
|
37
|
+
), f"expected bool, got {type(args.just_compile)}"
|
38
|
+
assert isinstance(
|
39
|
+
args.web, str | None
|
40
|
+
), f"expected str | None, got {type(args.web)}"
|
41
|
+
assert isinstance(
|
42
|
+
args.interactive, bool
|
43
|
+
), f"expected bool, got {type(args.interactive)}"
|
44
|
+
assert isinstance(
|
45
|
+
args.profile, bool
|
46
|
+
), f"expected bool, got {type(args.profile)}"
|
47
|
+
assert isinstance(
|
48
|
+
args.force_compile, bool
|
49
|
+
), f"expected bool, got {type(args.force_compile)}"
|
50
|
+
assert isinstance(
|
51
|
+
args.no_auto_updates, bool | None
|
52
|
+
), f"expected bool | None, got {type(args.no_auto_updates)}"
|
53
|
+
assert isinstance(args.update, bool), f"expected bool, got {type(args.update)}"
|
54
|
+
assert isinstance(
|
55
|
+
args.localhost, bool
|
56
|
+
), f"expected bool, got {type(args.localhost)}"
|
57
|
+
assert isinstance(args.build, bool), f"expected bool, got {type(args.build)}"
|
58
|
+
assert isinstance(args.server, bool), f"expected bool, got {type(args.server)}"
|
59
|
+
assert isinstance(args.purge, bool), f"expected bool, got {type(args.purge)}"
|
60
|
+
assert isinstance(args.debug, bool), f"expected bool, got {type(args.debug)}"
|
61
|
+
assert isinstance(args.quick, bool), f"expected bool, got {type(args.quick)}"
|
62
|
+
assert isinstance(
|
63
|
+
args.release, bool
|
64
|
+
), f"expected bool, got {type(args.release)}"
|
65
|
+
init: bool | str = False
|
66
|
+
if args.init is None:
|
67
|
+
init = False
|
68
|
+
elif isinstance(args.init, bool):
|
69
|
+
init = args.init
|
70
|
+
elif isinstance(args.init, str):
|
71
|
+
init = args.init
|
72
|
+
return Args(
|
73
|
+
directory=Path(args.directory) if args.directory else None,
|
74
|
+
init=init,
|
75
|
+
just_compile=args.just_compile,
|
76
|
+
web=args.web,
|
77
|
+
interactive=args.interactive,
|
78
|
+
profile=args.profile,
|
79
|
+
force_compile=args.force_compile,
|
80
|
+
auto_update=not args.no_auto_updates,
|
81
|
+
update=args.update,
|
82
|
+
localhost=args.localhost,
|
83
|
+
build=args.build,
|
84
|
+
server=args.server,
|
85
|
+
purge=args.purge,
|
86
|
+
debug=args.debug,
|
87
|
+
quick=args.quick,
|
88
|
+
release=args.release,
|
89
|
+
ram_disk_size=args.ram_disk_size,
|
90
|
+
)
|
fastled/client_server.py
CHANGED
@@ -129,7 +129,7 @@ def _run_web_compiler(
|
|
129
129
|
|
130
130
|
|
131
131
|
def _try_start_server_or_get_url(
|
132
|
-
auto_update: bool, args_web: str | bool, localhost: bool
|
132
|
+
auto_update: bool, args_web: str | bool, localhost: bool, clear: bool
|
133
133
|
) -> tuple[str, CompileServer | None]:
|
134
134
|
is_local_host = localhost or (
|
135
135
|
isinstance(args_web, str)
|
@@ -159,7 +159,9 @@ def _try_start_server_or_get_url(
|
|
159
159
|
else:
|
160
160
|
try:
|
161
161
|
print("No local server found, starting one...")
|
162
|
-
compile_server = CompileServer(
|
162
|
+
compile_server = CompileServer(
|
163
|
+
auto_updates=auto_update, remove_previous=clear
|
164
|
+
)
|
163
165
|
print("Waiting for the local compiler to start...")
|
164
166
|
if not compile_server.ping():
|
165
167
|
print("Failed to start local compiler.")
|
@@ -172,7 +174,7 @@ def _try_start_server_or_get_url(
|
|
172
174
|
return (DEFAULT_URL, None)
|
173
175
|
|
174
176
|
|
175
|
-
def _try_make_compile_server() -> CompileServer | None:
|
177
|
+
def _try_make_compile_server(clear: bool = False) -> CompileServer | None:
|
176
178
|
if not DockerManager.is_docker_installed():
|
177
179
|
return None
|
178
180
|
try:
|
@@ -184,7 +186,7 @@ def _try_make_compile_server() -> CompileServer | None:
|
|
184
186
|
free_port = find_free_port(start_port=9723, end_port=9743)
|
185
187
|
if free_port is None:
|
186
188
|
return None
|
187
|
-
compile_server = CompileServer(auto_updates=False)
|
189
|
+
compile_server = CompileServer(auto_updates=False, remove_previous=clear)
|
188
190
|
print("Waiting for the local compiler to start...")
|
189
191
|
if not compile_server.ping():
|
190
192
|
print("Failed to start local compiler.")
|
@@ -222,13 +224,14 @@ def run_client(
|
|
222
224
|
http_port: (
|
223
225
|
int | None
|
224
226
|
) = None, # None means auto select a free port, http_port < 0 means no server.
|
227
|
+
clear: bool = False,
|
225
228
|
) -> int:
|
226
229
|
has_checked_newer_version_yet = False
|
227
230
|
compile_server: CompileServer | None = None
|
228
231
|
|
229
232
|
if host is None:
|
230
233
|
# attempt to start a compile server if docker is installed.
|
231
|
-
compile_server = _try_make_compile_server()
|
234
|
+
compile_server = _try_make_compile_server(clear=clear)
|
232
235
|
if compile_server is None:
|
233
236
|
host = DEFAULT_URL
|
234
237
|
elif isinstance(host, CompileServer):
|
@@ -485,7 +488,9 @@ def run_client_server(args: Args) -> int:
|
|
485
488
|
url: str
|
486
489
|
compile_server: CompileServer | None = None
|
487
490
|
try:
|
488
|
-
url, compile_server = _try_start_server_or_get_url(
|
491
|
+
url, compile_server = _try_start_server_or_get_url(
|
492
|
+
auto_update, web, localhost, args.clear
|
493
|
+
)
|
489
494
|
except KeyboardInterrupt:
|
490
495
|
print("\nExiting from first try...")
|
491
496
|
if compile_server is not None:
|
@@ -505,6 +510,7 @@ def run_client_server(args: Args) -> int:
|
|
505
510
|
keep_running=not just_compile,
|
506
511
|
build_mode=build_mode,
|
507
512
|
profile=profile,
|
513
|
+
clear=args.clear,
|
508
514
|
)
|
509
515
|
except KeyboardInterrupt:
|
510
516
|
return 1
|
fastled/docker_manager.py
CHANGED
@@ -36,6 +36,9 @@ _IS_GITHUB = "GITHUB_ACTIONS" in os.environ
|
|
36
36
|
_DEFAULT_BUILD_DIR = "/js/.pio/build"
|
37
37
|
|
38
38
|
|
39
|
+
os.environ.get("FASTLED_FORCE_CLEAR", "0") == "1"
|
40
|
+
|
41
|
+
|
39
42
|
# Docker uses datetimes in UTC but without the timezone info. If we pass in a tz
|
40
43
|
# then it will throw an exception.
|
41
44
|
def _utc_now_no_tz() -> datetime:
|
@@ -65,6 +68,10 @@ def get_ramdisk_size() -> str | None:
|
|
65
68
|
return None # Defaults to off
|
66
69
|
|
67
70
|
|
71
|
+
def set_clear() -> None:
|
72
|
+
os.environ["FASTLED_FORCE_CLEAR"] = "1"
|
73
|
+
|
74
|
+
|
68
75
|
def _win32_docker_location() -> str | None:
|
69
76
|
home_dir = Path.home()
|
70
77
|
out = [
|
fastled/parse_args.py
CHANGED
@@ -3,6 +3,7 @@ import os
|
|
3
3
|
import sys
|
4
4
|
from pathlib import Path
|
5
5
|
|
6
|
+
from fastled.args import Args
|
6
7
|
from fastled.project_init import project_init
|
7
8
|
from fastled.select_sketch_directory import select_sketch_directory
|
8
9
|
from fastled.settings import DEFAULT_URL, IMAGE_NAME
|
@@ -11,7 +12,6 @@ from fastled.sketch import (
|
|
11
12
|
looks_like_fastled_repo,
|
12
13
|
looks_like_sketch_directory,
|
13
14
|
)
|
14
|
-
from fastled.types import Args
|
15
15
|
|
16
16
|
|
17
17
|
def _find_fastled_repo(start: Path) -> Path | None:
|
fastled/types.py
CHANGED
@@ -1,98 +1,11 @@
|
|
1
|
-
import argparse
|
2
1
|
from dataclasses import dataclass
|
3
2
|
from enum import Enum
|
4
|
-
from pathlib import Path
|
5
3
|
from typing import Any
|
6
4
|
|
5
|
+
from fastled.args import Args
|
7
6
|
from fastled.print_filter import PrintFilterFastled
|
8
7
|
|
9
8
|
|
10
|
-
@dataclass
|
11
|
-
class Args:
|
12
|
-
directory: Path | None
|
13
|
-
init: bool | str
|
14
|
-
just_compile: bool
|
15
|
-
web: str | None
|
16
|
-
interactive: bool
|
17
|
-
profile: bool
|
18
|
-
force_compile: bool
|
19
|
-
auto_update: bool | None
|
20
|
-
update: bool
|
21
|
-
localhost: bool
|
22
|
-
build: bool
|
23
|
-
server: bool
|
24
|
-
purge: bool
|
25
|
-
debug: bool
|
26
|
-
quick: bool
|
27
|
-
release: bool
|
28
|
-
ram_disk_size: str # suffixed liked "25mb" or "1gb"
|
29
|
-
|
30
|
-
@staticmethod
|
31
|
-
def from_namespace(args: argparse.Namespace) -> "Args":
|
32
|
-
assert isinstance(
|
33
|
-
args.directory, str | None
|
34
|
-
), f"expected str | None, got {type(args.directory)}"
|
35
|
-
assert isinstance(
|
36
|
-
args.init, bool | str | None
|
37
|
-
), f"expected bool, got {type(args.init)}"
|
38
|
-
assert isinstance(
|
39
|
-
args.just_compile, bool
|
40
|
-
), f"expected bool, got {type(args.just_compile)}"
|
41
|
-
assert isinstance(
|
42
|
-
args.web, str | None
|
43
|
-
), f"expected str | None, got {type(args.web)}"
|
44
|
-
assert isinstance(
|
45
|
-
args.interactive, bool
|
46
|
-
), f"expected bool, got {type(args.interactive)}"
|
47
|
-
assert isinstance(
|
48
|
-
args.profile, bool
|
49
|
-
), f"expected bool, got {type(args.profile)}"
|
50
|
-
assert isinstance(
|
51
|
-
args.force_compile, bool
|
52
|
-
), f"expected bool, got {type(args.force_compile)}"
|
53
|
-
assert isinstance(
|
54
|
-
args.no_auto_updates, bool | None
|
55
|
-
), f"expected bool | None, got {type(args.no_auto_updates)}"
|
56
|
-
assert isinstance(args.update, bool), f"expected bool, got {type(args.update)}"
|
57
|
-
assert isinstance(
|
58
|
-
args.localhost, bool
|
59
|
-
), f"expected bool, got {type(args.localhost)}"
|
60
|
-
assert isinstance(args.build, bool), f"expected bool, got {type(args.build)}"
|
61
|
-
assert isinstance(args.server, bool), f"expected bool, got {type(args.server)}"
|
62
|
-
assert isinstance(args.purge, bool), f"expected bool, got {type(args.purge)}"
|
63
|
-
assert isinstance(args.debug, bool), f"expected bool, got {type(args.debug)}"
|
64
|
-
assert isinstance(args.quick, bool), f"expected bool, got {type(args.quick)}"
|
65
|
-
assert isinstance(
|
66
|
-
args.release, bool
|
67
|
-
), f"expected bool, got {type(args.release)}"
|
68
|
-
init: bool | str = False
|
69
|
-
if args.init is None:
|
70
|
-
init = False
|
71
|
-
elif isinstance(args.init, bool):
|
72
|
-
init = args.init
|
73
|
-
elif isinstance(args.init, str):
|
74
|
-
init = args.init
|
75
|
-
return Args(
|
76
|
-
directory=Path(args.directory) if args.directory else None,
|
77
|
-
init=init,
|
78
|
-
just_compile=args.just_compile,
|
79
|
-
web=args.web,
|
80
|
-
interactive=args.interactive,
|
81
|
-
profile=args.profile,
|
82
|
-
force_compile=args.force_compile,
|
83
|
-
auto_update=not args.no_auto_updates,
|
84
|
-
update=args.update,
|
85
|
-
localhost=args.localhost,
|
86
|
-
build=args.build,
|
87
|
-
server=args.server,
|
88
|
-
purge=args.purge,
|
89
|
-
debug=args.debug,
|
90
|
-
quick=args.quick,
|
91
|
-
release=args.release,
|
92
|
-
ram_disk_size=args.ram_disk_size,
|
93
|
-
)
|
94
|
-
|
95
|
-
|
96
9
|
@dataclass
|
97
10
|
class CompileResult:
|
98
11
|
success: bool
|
@@ -1,19 +1,20 @@
|
|
1
1
|
fastled/__init__.py,sha256=YLikXGRWKlKAqj7bpvGmJLejGTFF-FC1lv2z1jwRinA,6852
|
2
|
-
fastled/__version__.py,sha256=
|
3
|
-
fastled/app.py,sha256=
|
2
|
+
fastled/__version__.py,sha256=7QpiB0fkCVDeQpQ85nRmXbvX0zrIl80FW316eQ25yMc,373
|
3
|
+
fastled/app.py,sha256=UObQfgAcFSLXr_N04D4PSI15_p5CFz4bEj_MuBMHyKE,5859
|
4
|
+
fastled/args.py,sha256=chqZa6mRbqWBEvfs8vbw3Z3SQczk22_JcvDwv2vGZdY,3280
|
4
5
|
fastled/cli.py,sha256=5EBsb02ueFUjlgrlg0GMdj3e5nnHVhvofmYyQRaw8uM,565
|
5
6
|
fastled/cli_test.py,sha256=qJB9yLRFR3OwOwdIWSQ0fQsWLnA37v5pDccufiP_hTs,512
|
6
7
|
fastled/cli_test_interactive.py,sha256=BjNhveZOk5aCffHbcrxPQQjWmAuj4ClVKKcKX5eY6yM,542
|
7
|
-
fastled/client_server.py,sha256=
|
8
|
+
fastled/client_server.py,sha256=uK-reqTN4umtVm8K3fcLo2Op_P_jFKVFtKFJRpBF1Xs,18598
|
8
9
|
fastled/compile_server.py,sha256=rkXvrvdav5vDG8lv_OlBX3YSCHtnHMt25nXbfeg_r78,2960
|
9
10
|
fastled/compile_server_impl.py,sha256=MIe-GvKenoDaqX8VhCJ7KNIWTOHHcLPgUQ7kO6lsa38,12199
|
10
|
-
fastled/docker_manager.py,sha256=
|
11
|
+
fastled/docker_manager.py,sha256=aF4_XH_1FF7pW0CB1DKOwyVEf2PbejBmzDXOzthEnL8,39383
|
11
12
|
fastled/filewatcher.py,sha256=3qS3L7zMQhFuVrkeGn1djsB_cB6x_E2YGJmmQWVAU_w,10033
|
12
13
|
fastled/keyboard.py,sha256=UTAsqCn1UMYnB8YDzENiLTj4GeL45tYfEcO7_5fLFEg,3556
|
13
14
|
fastled/keyz.py,sha256=LO-8m_7CpNDiZLM-FXhQ30f9gN1bUYz5lOsUPTIbI-c,4020
|
14
15
|
fastled/live_client.py,sha256=yoAul8tVgbbPf1oEC79SUZSHkLECxlrXxgWR9XaBIp4,2957
|
15
16
|
fastled/open_browser.py,sha256=DFyMrc1qic4Go7eLNPqMaLuMvTaE73NixdfSKV0yyp8,3709
|
16
|
-
fastled/parse_args.py,sha256=
|
17
|
+
fastled/parse_args.py,sha256=EnJa0FZi8RPtIzldK-CJRJvQhl83rCzz-oQrIDok2e8,9937
|
17
18
|
fastled/paths.py,sha256=VsPmgu0lNSCFOoEC0BsTYzDygXqy15AHUfN-tTuzDZA,99
|
18
19
|
fastled/print_filter.py,sha256=oomBjrouWNPCgJY2guCpljTijFvNKRBVbipDrxIsszA,7426
|
19
20
|
fastled/project_init.py,sha256=bBt4DwmW5hZkm9ICt9Qk-0Nr_0JQM7icCgH5Iv-bCQs,3984
|
@@ -24,7 +25,7 @@ fastled/settings.py,sha256=dUVyJ8Mtprg0RwaS6oMWP8jBhr4C3R8fu4Hdx_Z1lCM,577
|
|
24
25
|
fastled/sketch.py,sha256=Ftbh55Nt-p4hmPuPpj8Q9HrMzvnUazhoG_q9FHcxkns,3473
|
25
26
|
fastled/spinner.py,sha256=VHxmvB92P0Z_zYxRajb5HiNmkHHvZ5dG7hKtZltzpcs,867
|
26
27
|
fastled/string_diff.py,sha256=NbtYxvBFxTUdmTpMLizlgZj2ULJ-7etj72GBdWDTGws,2496
|
27
|
-
fastled/types.py,sha256=
|
28
|
+
fastled/types.py,sha256=m7df4YxPPxl9GcfTAr_Lc9wSCE3fVzpcQf9-X0cMYuQ,1803
|
28
29
|
fastled/util.py,sha256=hw3gxS1qGc5LL_QN88_VIjut6T0-61ImDQpxGp11DXY,1189
|
29
30
|
fastled/version.py,sha256=TpBMiEVdO3_sUZEu6wmwN8Q4AgX2BiCxStCsnPKh6E0,1209
|
30
31
|
fastled/web_compile.py,sha256=R159Od1VqeXTW6y3rQY0_P9f0CJYbPuBiMLqb-zBCUQ,11526
|
@@ -35,9 +36,9 @@ fastled/site/build.py,sha256=2YKU_UWKlJdGnjdbAbaL0co6kceFMSTVYwH1KCmgPZA,13987
|
|
35
36
|
fastled/site/examples.py,sha256=s6vj2zJc6BfKlnbwXr1QWY1mzuDBMt6j5MEBOWjO_U8,155
|
36
37
|
fastled/test/can_run_local_docker_tests.py,sha256=LEuUbHctRhNNFWcvnz2kEGmjDJeXO4c3kNpizm3yVJs,400
|
37
38
|
fastled/test/examples.py,sha256=GfaHeY1E8izBl6ZqDVjz--RHLyVR4NRnQ5pBesCFJFY,1673
|
38
|
-
fastled-1.3.
|
39
|
-
fastled-1.3.
|
40
|
-
fastled-1.3.
|
41
|
-
fastled-1.3.
|
42
|
-
fastled-1.3.
|
43
|
-
fastled-1.3.
|
39
|
+
fastled-1.3.10.dist-info/licenses/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
|
40
|
+
fastled-1.3.10.dist-info/METADATA,sha256=EXXCG6ZWbD_tSmhsyDNMWx8_MXI20qZPaO9o09mWCKc,30050
|
41
|
+
fastled-1.3.10.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
42
|
+
fastled-1.3.10.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
|
43
|
+
fastled-1.3.10.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
|
44
|
+
fastled-1.3.10.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|