fastled 1.3.13__py3-none-any.whl → 1.3.15__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 +177 -177
- fastled/client_server.py +519 -519
- fastled/compile_server_impl.py +3 -4
- fastled/docker_manager.py +1068 -1068
- fastled/open_browser.py +137 -137
- fastled/parse_args.py +301 -301
- fastled/print_filter.py +247 -247
- fastled/project_init.py +129 -129
- fastled/site/build.py +449 -449
- fastled/string_diff.py +82 -82
- fastled/util.py +11 -6
- fastled/version.py +41 -41
- {fastled-1.3.13.dist-info → fastled-1.3.15.dist-info}/METADATA +477 -473
- {fastled-1.3.13.dist-info → fastled-1.3.15.dist-info}/RECORD +19 -19
- {fastled-1.3.13.dist-info → fastled-1.3.15.dist-info}/WHEEL +1 -1
- {fastled-1.3.13.dist-info → fastled-1.3.15.dist-info}/entry_points.txt +0 -0
- {fastled-1.3.13.dist-info → fastled-1.3.15.dist-info}/licenses/LICENSE +0 -0
- {fastled-1.3.13.dist-info → fastled-1.3.15.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.15"
|
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
@@ -1,177 +1,177 @@
|
|
1
|
-
"""
|
2
|
-
Uses the latest wasm compiler image to compile the FastLED sketch.
|
3
|
-
"""
|
4
|
-
|
5
|
-
import os
|
6
|
-
import sys
|
7
|
-
import time
|
8
|
-
from pathlib import Path
|
9
|
-
|
10
|
-
from fastled.client_server import run_client_server
|
11
|
-
from fastled.compile_server import CompileServer
|
12
|
-
from fastled.filewatcher import file_watcher_set
|
13
|
-
from fastled.parse_args import Args, parse_args
|
14
|
-
from fastled.sketch import find_sketch_directories, looks_like_fastled_repo
|
15
|
-
|
16
|
-
|
17
|
-
def run_server(args: Args) -> int:
|
18
|
-
interactive = args.interactive
|
19
|
-
auto_update = args.auto_update
|
20
|
-
mapped_dir = Path(args.directory).absolute() if args.directory else None
|
21
|
-
if interactive and mapped_dir is None:
|
22
|
-
print("Select a sketch when you enter interactive mode.")
|
23
|
-
return 1
|
24
|
-
compile_server = CompileServer(
|
25
|
-
interactive=interactive,
|
26
|
-
auto_updates=auto_update,
|
27
|
-
mapped_dir=mapped_dir,
|
28
|
-
auto_start=True,
|
29
|
-
remove_previous=args.clear,
|
30
|
-
)
|
31
|
-
|
32
|
-
if not interactive:
|
33
|
-
print(f"Server started at {compile_server.url()}")
|
34
|
-
try:
|
35
|
-
while True:
|
36
|
-
if not compile_server.process_running():
|
37
|
-
print("Server process is not running. Exiting...")
|
38
|
-
return 1
|
39
|
-
time.sleep(0.1)
|
40
|
-
except KeyboardInterrupt:
|
41
|
-
print("\nExiting from server...")
|
42
|
-
return 1
|
43
|
-
finally:
|
44
|
-
compile_server.stop()
|
45
|
-
return 0
|
46
|
-
|
47
|
-
|
48
|
-
def main() -> int:
|
49
|
-
from fastled import __version__
|
50
|
-
from fastled.select_sketch_directory import select_sketch_directory
|
51
|
-
|
52
|
-
args = parse_args()
|
53
|
-
interactive: bool = args.interactive
|
54
|
-
has_server = args.server
|
55
|
-
update: bool = args.update
|
56
|
-
build: bool = args.build
|
57
|
-
just_compile: bool = args.just_compile
|
58
|
-
# directory: Path | None = Path(args.directory).absolute() if args.directory else None
|
59
|
-
directory: Path | None = Path(args.directory) if args.directory else None
|
60
|
-
cwd_looks_like_fastled_repo = looks_like_fastled_repo()
|
61
|
-
|
62
|
-
# now it is safe to print out the version
|
63
|
-
print(f"FastLED version: {__version__}")
|
64
|
-
|
65
|
-
# Resolve some of the last interactive arguments
|
66
|
-
# 1. If interactive is set and the sketch directory is not given,
|
67
|
-
# then prompt the user for a sketch directory.
|
68
|
-
# 2. Tell the user they can use --server --interactive to
|
69
|
-
# skip this prompt.
|
70
|
-
if interactive and cwd_looks_like_fastled_repo and directory is None:
|
71
|
-
answer = input(
|
72
|
-
"No sketch directory selected, would you like to select one? (y/n): "
|
73
|
-
)
|
74
|
-
if answer.lower()[:1] == "y" or answer.lower() == "":
|
75
|
-
sketch_list: list[Path] = find_sketch_directories()
|
76
|
-
if sketch_list:
|
77
|
-
maybe_dir: str | None = select_sketch_directory(
|
78
|
-
sketch_list, cwd_looks_like_fastled_repo
|
79
|
-
)
|
80
|
-
if maybe_dir is not None:
|
81
|
-
directory = Path(maybe_dir)
|
82
|
-
if not directory.exists():
|
83
|
-
print(
|
84
|
-
f"Directory {directory} does not exist, entering interactive mode without project mapped in."
|
85
|
-
)
|
86
|
-
directory = None
|
87
|
-
|
88
|
-
if update:
|
89
|
-
# Force auto_update to ensure update check happens
|
90
|
-
compile_server = CompileServer(interactive=False, auto_updates=True)
|
91
|
-
compile_server.stop()
|
92
|
-
print("Finished updating.")
|
93
|
-
return 0
|
94
|
-
|
95
|
-
if build:
|
96
|
-
print("Building is disabled")
|
97
|
-
build = False
|
98
|
-
|
99
|
-
if interactive:
|
100
|
-
# raise NotImplementedError("Building is not yet supported.")
|
101
|
-
file_watcher_set(False)
|
102
|
-
# project_root = Path(".").absolute()
|
103
|
-
# print(f"Building Docker image at {project_root}")
|
104
|
-
from fastled import Api
|
105
|
-
|
106
|
-
server: CompileServer = CompileServer(
|
107
|
-
interactive=interactive,
|
108
|
-
auto_updates=False,
|
109
|
-
mapped_dir=directory,
|
110
|
-
auto_start=False,
|
111
|
-
remove_previous=args.clear,
|
112
|
-
)
|
113
|
-
|
114
|
-
server.start(wait_for_startup=False)
|
115
|
-
|
116
|
-
try:
|
117
|
-
while server.process_running():
|
118
|
-
# wait for ctrl-c
|
119
|
-
time.sleep(0.1)
|
120
|
-
except KeyboardInterrupt:
|
121
|
-
print("\nExiting from server...")
|
122
|
-
server.stop()
|
123
|
-
return 0
|
124
|
-
|
125
|
-
try:
|
126
|
-
if interactive:
|
127
|
-
server.stop()
|
128
|
-
return 0
|
129
|
-
print(f"Built Docker image: {server.name}")
|
130
|
-
if not directory:
|
131
|
-
if not directory:
|
132
|
-
print("No directory specified")
|
133
|
-
server.stop()
|
134
|
-
return 0
|
135
|
-
|
136
|
-
print("Running server")
|
137
|
-
|
138
|
-
with Api.live_client(
|
139
|
-
auto_updates=False,
|
140
|
-
sketch_directory=directory,
|
141
|
-
host=server,
|
142
|
-
auto_start=True,
|
143
|
-
keep_running=not just_compile,
|
144
|
-
) as _:
|
145
|
-
while True:
|
146
|
-
time.sleep(0.2) # wait for user to exit
|
147
|
-
except KeyboardInterrupt:
|
148
|
-
print("\nExiting from client...")
|
149
|
-
server.stop()
|
150
|
-
return 1
|
151
|
-
|
152
|
-
if has_server:
|
153
|
-
print("Running in server only mode.")
|
154
|
-
return run_server(args)
|
155
|
-
else:
|
156
|
-
print("Running in client/server mode.")
|
157
|
-
return run_client_server(args)
|
158
|
-
|
159
|
-
|
160
|
-
if __name__ == "__main__":
|
161
|
-
# Note that the entry point for the exe is in cli.py
|
162
|
-
try:
|
163
|
-
# sys.argv.append("-i")
|
164
|
-
# sys.argv.append("-b")
|
165
|
-
# sys.argv.append("examples/wasm")
|
166
|
-
# sys.argv.append()
|
167
|
-
import os
|
168
|
-
|
169
|
-
os.chdir("../fastled")
|
170
|
-
sys.argv.append("examples/FxWave2d")
|
171
|
-
sys.exit(main())
|
172
|
-
except KeyboardInterrupt:
|
173
|
-
print("\nExiting from main...")
|
174
|
-
sys.exit(1)
|
175
|
-
except Exception as e:
|
176
|
-
print(f"Error: {e}")
|
177
|
-
sys.exit(1)
|
1
|
+
"""
|
2
|
+
Uses the latest wasm compiler image to compile the FastLED sketch.
|
3
|
+
"""
|
4
|
+
|
5
|
+
import os
|
6
|
+
import sys
|
7
|
+
import time
|
8
|
+
from pathlib import Path
|
9
|
+
|
10
|
+
from fastled.client_server import run_client_server
|
11
|
+
from fastled.compile_server import CompileServer
|
12
|
+
from fastled.filewatcher import file_watcher_set
|
13
|
+
from fastled.parse_args import Args, parse_args
|
14
|
+
from fastled.sketch import find_sketch_directories, looks_like_fastled_repo
|
15
|
+
|
16
|
+
|
17
|
+
def run_server(args: Args) -> int:
|
18
|
+
interactive = args.interactive
|
19
|
+
auto_update = args.auto_update
|
20
|
+
mapped_dir = Path(args.directory).absolute() if args.directory else None
|
21
|
+
if interactive and mapped_dir is None:
|
22
|
+
print("Select a sketch when you enter interactive mode.")
|
23
|
+
return 1
|
24
|
+
compile_server = CompileServer(
|
25
|
+
interactive=interactive,
|
26
|
+
auto_updates=auto_update,
|
27
|
+
mapped_dir=mapped_dir,
|
28
|
+
auto_start=True,
|
29
|
+
remove_previous=args.clear,
|
30
|
+
)
|
31
|
+
|
32
|
+
if not interactive:
|
33
|
+
print(f"Server started at {compile_server.url()}")
|
34
|
+
try:
|
35
|
+
while True:
|
36
|
+
if not compile_server.process_running():
|
37
|
+
print("Server process is not running. Exiting...")
|
38
|
+
return 1
|
39
|
+
time.sleep(0.1)
|
40
|
+
except KeyboardInterrupt:
|
41
|
+
print("\nExiting from server...")
|
42
|
+
return 1
|
43
|
+
finally:
|
44
|
+
compile_server.stop()
|
45
|
+
return 0
|
46
|
+
|
47
|
+
|
48
|
+
def main() -> int:
|
49
|
+
from fastled import __version__
|
50
|
+
from fastled.select_sketch_directory import select_sketch_directory
|
51
|
+
|
52
|
+
args = parse_args()
|
53
|
+
interactive: bool = args.interactive
|
54
|
+
has_server = args.server
|
55
|
+
update: bool = args.update
|
56
|
+
build: bool = args.build
|
57
|
+
just_compile: bool = args.just_compile
|
58
|
+
# directory: Path | None = Path(args.directory).absolute() if args.directory else None
|
59
|
+
directory: Path | None = Path(args.directory) if args.directory else None
|
60
|
+
cwd_looks_like_fastled_repo = looks_like_fastled_repo()
|
61
|
+
|
62
|
+
# now it is safe to print out the version
|
63
|
+
print(f"FastLED version: {__version__}")
|
64
|
+
|
65
|
+
# Resolve some of the last interactive arguments
|
66
|
+
# 1. If interactive is set and the sketch directory is not given,
|
67
|
+
# then prompt the user for a sketch directory.
|
68
|
+
# 2. Tell the user they can use --server --interactive to
|
69
|
+
# skip this prompt.
|
70
|
+
if interactive and cwd_looks_like_fastled_repo and directory is None:
|
71
|
+
answer = input(
|
72
|
+
"No sketch directory selected, would you like to select one? (y/n): "
|
73
|
+
)
|
74
|
+
if answer.lower()[:1] == "y" or answer.lower() == "":
|
75
|
+
sketch_list: list[Path] = find_sketch_directories()
|
76
|
+
if sketch_list:
|
77
|
+
maybe_dir: str | None = select_sketch_directory(
|
78
|
+
sketch_list, cwd_looks_like_fastled_repo
|
79
|
+
)
|
80
|
+
if maybe_dir is not None:
|
81
|
+
directory = Path(maybe_dir)
|
82
|
+
if not directory.exists():
|
83
|
+
print(
|
84
|
+
f"Directory {directory} does not exist, entering interactive mode without project mapped in."
|
85
|
+
)
|
86
|
+
directory = None
|
87
|
+
|
88
|
+
if update:
|
89
|
+
# Force auto_update to ensure update check happens
|
90
|
+
compile_server = CompileServer(interactive=False, auto_updates=True)
|
91
|
+
compile_server.stop()
|
92
|
+
print("Finished updating.")
|
93
|
+
return 0
|
94
|
+
|
95
|
+
if build:
|
96
|
+
print("Building is disabled")
|
97
|
+
build = False
|
98
|
+
|
99
|
+
if interactive:
|
100
|
+
# raise NotImplementedError("Building is not yet supported.")
|
101
|
+
file_watcher_set(False)
|
102
|
+
# project_root = Path(".").absolute()
|
103
|
+
# print(f"Building Docker image at {project_root}")
|
104
|
+
from fastled import Api
|
105
|
+
|
106
|
+
server: CompileServer = CompileServer(
|
107
|
+
interactive=interactive,
|
108
|
+
auto_updates=False,
|
109
|
+
mapped_dir=directory,
|
110
|
+
auto_start=False,
|
111
|
+
remove_previous=args.clear,
|
112
|
+
)
|
113
|
+
|
114
|
+
server.start(wait_for_startup=False)
|
115
|
+
|
116
|
+
try:
|
117
|
+
while server.process_running():
|
118
|
+
# wait for ctrl-c
|
119
|
+
time.sleep(0.1)
|
120
|
+
except KeyboardInterrupt:
|
121
|
+
print("\nExiting from server...")
|
122
|
+
server.stop()
|
123
|
+
return 0
|
124
|
+
|
125
|
+
try:
|
126
|
+
if interactive:
|
127
|
+
server.stop()
|
128
|
+
return 0
|
129
|
+
print(f"Built Docker image: {server.name}")
|
130
|
+
if not directory:
|
131
|
+
if not directory:
|
132
|
+
print("No directory specified")
|
133
|
+
server.stop()
|
134
|
+
return 0
|
135
|
+
|
136
|
+
print("Running server")
|
137
|
+
|
138
|
+
with Api.live_client(
|
139
|
+
auto_updates=False,
|
140
|
+
sketch_directory=directory,
|
141
|
+
host=server,
|
142
|
+
auto_start=True,
|
143
|
+
keep_running=not just_compile,
|
144
|
+
) as _:
|
145
|
+
while True:
|
146
|
+
time.sleep(0.2) # wait for user to exit
|
147
|
+
except KeyboardInterrupt:
|
148
|
+
print("\nExiting from client...")
|
149
|
+
server.stop()
|
150
|
+
return 1
|
151
|
+
|
152
|
+
if has_server:
|
153
|
+
print("Running in server only mode.")
|
154
|
+
return run_server(args)
|
155
|
+
else:
|
156
|
+
print("Running in client/server mode.")
|
157
|
+
return run_client_server(args)
|
158
|
+
|
159
|
+
|
160
|
+
if __name__ == "__main__":
|
161
|
+
# Note that the entry point for the exe is in cli.py
|
162
|
+
try:
|
163
|
+
# sys.argv.append("-i")
|
164
|
+
# sys.argv.append("-b")
|
165
|
+
# sys.argv.append("examples/wasm")
|
166
|
+
# sys.argv.append()
|
167
|
+
import os
|
168
|
+
|
169
|
+
os.chdir("../fastled")
|
170
|
+
sys.argv.append("examples/FxWave2d")
|
171
|
+
sys.exit(main())
|
172
|
+
except KeyboardInterrupt:
|
173
|
+
print("\nExiting from main...")
|
174
|
+
sys.exit(1)
|
175
|
+
except Exception as e:
|
176
|
+
print(f"Error: {e}")
|
177
|
+
sys.exit(1)
|