fastled 1.2.0__py3-none-any.whl → 1.2.2__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 +34 -1
- fastled/compile_server_impl.py +5 -9
- fastled/docker_manager.py +29 -0
- fastled/parse_args.py +15 -2
- fastled/settings.py +4 -0
- {fastled-1.2.0.dist-info → fastled-1.2.2.dist-info}/METADATA +3 -1
- {fastled-1.2.0.dist-info → fastled-1.2.2.dist-info}/RECORD +11 -11
- {fastled-1.2.0.dist-info → fastled-1.2.2.dist-info}/LICENSE +0 -0
- {fastled-1.2.0.dist-info → fastled-1.2.2.dist-info}/WHEEL +0 -0
- {fastled-1.2.0.dist-info → fastled-1.2.2.dist-info}/entry_points.txt +0 -0
- {fastled-1.2.0.dist-info → fastled-1.2.2.dist-info}/top_level.txt +0 -0
fastled/__init__.py
CHANGED
@@ -13,7 +13,7 @@ from .types import BuildMode, CompileResult, CompileServerError
|
|
13
13
|
# IMPORTANT! There's a bug in github which will REJECT any version update
|
14
14
|
# that has any other change in the repo. Please bump the version as the
|
15
15
|
# ONLY change in a commit, or else the pypi update and the release will fail.
|
16
|
-
__version__ = "1.2.
|
16
|
+
__version__ = "1.2.2"
|
17
17
|
|
18
18
|
|
19
19
|
class Api:
|
@@ -112,7 +112,40 @@ class Api:
|
|
112
112
|
server.stop()
|
113
113
|
|
114
114
|
|
115
|
+
class Docker:
|
116
|
+
@staticmethod
|
117
|
+
def is_installed() -> bool:
|
118
|
+
from fastled.docker_manager import DockerManager
|
119
|
+
|
120
|
+
return DockerManager.is_docker_installed()
|
121
|
+
|
122
|
+
@staticmethod
|
123
|
+
def is_running() -> bool:
|
124
|
+
from fastled.docker_manager import DockerManager
|
125
|
+
|
126
|
+
return DockerManager.is_running()
|
127
|
+
|
128
|
+
@staticmethod
|
129
|
+
def is_container_running(container_name: str | None = None) -> bool:
|
130
|
+
# from fastled.docker import is_container_running
|
131
|
+
from fastled.docker_manager import DockerManager
|
132
|
+
from fastled.settings import CONTAINER_NAME
|
133
|
+
|
134
|
+
docker = DockerManager()
|
135
|
+
container_name = container_name or CONTAINER_NAME
|
136
|
+
return docker.is_container_running(container_name)
|
137
|
+
|
138
|
+
@staticmethod
|
139
|
+
def purge() -> None:
|
140
|
+
from fastled.docker_manager import DockerManager
|
141
|
+
from fastled.settings import CONTAINER_NAME
|
142
|
+
|
143
|
+
docker = DockerManager()
|
144
|
+
docker.purge(CONTAINER_NAME)
|
145
|
+
|
146
|
+
|
115
147
|
class Test:
|
148
|
+
__test__ = False # This prevents unittest from recognizing it as a test class.
|
116
149
|
|
117
150
|
@staticmethod
|
118
151
|
def can_run_local_docker_tests() -> bool:
|
fastled/compile_server_impl.py
CHANGED
@@ -12,14 +12,10 @@ from fastled.docker_manager import (
|
|
12
12
|
DockerManager,
|
13
13
|
RunningContainer,
|
14
14
|
)
|
15
|
-
from fastled.settings import SERVER_PORT
|
15
|
+
from fastled.settings import DEFAULT_CONTAINER_NAME, IMAGE_NAME, SERVER_PORT
|
16
16
|
from fastled.sketch import looks_like_fastled_repo
|
17
17
|
from fastled.types import BuildMode, CompileResult, CompileServerError
|
18
18
|
|
19
|
-
_IMAGE_NAME = "niteris/fastled-wasm"
|
20
|
-
_DEFAULT_CONTAINER_NAME = "fastled-wasm-compiler"
|
21
|
-
|
22
|
-
|
23
19
|
SERVER_OPTIONS = [
|
24
20
|
"--allow-shutdown", # Allow the server to be shut down without a force kill.
|
25
21
|
"--no-auto-update", # Don't auto live updates from the git repo.
|
@@ -46,7 +42,7 @@ class CompileServerImpl:
|
|
46
42
|
auto_start: bool = True,
|
47
43
|
container_name: str | None = None,
|
48
44
|
) -> None:
|
49
|
-
container_name = container_name or
|
45
|
+
container_name = container_name or DEFAULT_CONTAINER_NAME
|
50
46
|
if interactive and not mapped_dir:
|
51
47
|
raise ValueError(
|
52
48
|
"Interactive mode requires a mapped directory point to a sketch"
|
@@ -178,7 +174,7 @@ class CompileServerImpl:
|
|
178
174
|
else:
|
179
175
|
upgrade = self.auto_updates
|
180
176
|
self.docker.validate_or_download_image(
|
181
|
-
image_name=
|
177
|
+
image_name=IMAGE_NAME, tag="main", upgrade=upgrade
|
182
178
|
)
|
183
179
|
DISK_CACHE.put("last-update", now_str)
|
184
180
|
|
@@ -214,7 +210,7 @@ class CompileServerImpl:
|
|
214
210
|
cmd_str = subprocess.list2cmdline(server_command)
|
215
211
|
if not self.interactive:
|
216
212
|
container: Container = self.docker.run_container_detached(
|
217
|
-
image_name=
|
213
|
+
image_name=IMAGE_NAME,
|
218
214
|
tag="main",
|
219
215
|
container_name=self.container_name,
|
220
216
|
command=cmd_str,
|
@@ -228,7 +224,7 @@ class CompileServerImpl:
|
|
228
224
|
return port
|
229
225
|
else:
|
230
226
|
self.docker.run_container_interactive(
|
231
|
-
image_name=
|
227
|
+
image_name=IMAGE_NAME,
|
232
228
|
tag="main",
|
233
229
|
container_name=self.container_name,
|
234
230
|
command=cmd_str,
|
fastled/docker_manager.py
CHANGED
@@ -610,6 +610,35 @@ class DockerManager:
|
|
610
610
|
print(f"Container {container_name} not found.")
|
611
611
|
return False
|
612
612
|
|
613
|
+
def purge(self, image_name: str) -> None:
|
614
|
+
"""
|
615
|
+
Remove all containers and images associated with the given image name.
|
616
|
+
|
617
|
+
Args:
|
618
|
+
image_name: The name of the image to purge (without tag)
|
619
|
+
"""
|
620
|
+
print(f"Purging all containers and images for {image_name}...")
|
621
|
+
|
622
|
+
# Remove all containers using this image
|
623
|
+
try:
|
624
|
+
containers = self.client.containers.list(all=True)
|
625
|
+
for container in containers:
|
626
|
+
if any(image_name in tag for tag in container.image.tags):
|
627
|
+
print(f"Removing container {container.name}")
|
628
|
+
container.remove(force=True)
|
629
|
+
except Exception as e:
|
630
|
+
print(f"Error removing containers: {e}")
|
631
|
+
|
632
|
+
# Remove all images with this name
|
633
|
+
try:
|
634
|
+
images = self.client.images.list()
|
635
|
+
for image in images:
|
636
|
+
if any(image_name in tag for tag in image.tags):
|
637
|
+
print(f"Removing image {image.tags}")
|
638
|
+
self.client.images.remove(image.id, force=True)
|
639
|
+
except Exception as e:
|
640
|
+
print(f"Error removing images: {e}")
|
641
|
+
|
613
642
|
|
614
643
|
def main():
|
615
644
|
# Register SIGINT handler
|
fastled/parse_args.py
CHANGED
@@ -4,10 +4,9 @@ import sys
|
|
4
4
|
from pathlib import Path
|
5
5
|
|
6
6
|
from fastled import __version__
|
7
|
-
from fastled.docker_manager import DockerManager
|
8
7
|
from fastled.project_init import project_init
|
9
8
|
from fastled.select_sketch_directory import select_sketch_directory
|
10
|
-
from fastled.settings import DEFAULT_URL
|
9
|
+
from fastled.settings import DEFAULT_URL, IMAGE_NAME
|
11
10
|
from fastled.sketch import (
|
12
11
|
find_sketch_directories,
|
13
12
|
looks_like_fastled_repo,
|
@@ -86,6 +85,11 @@ def parse_args() -> argparse.Namespace:
|
|
86
85
|
action="store_true",
|
87
86
|
help="Run the server in the current directory, volume mapping fastled if we are in the repo",
|
88
87
|
)
|
88
|
+
parser.add_argument(
|
89
|
+
"--purge",
|
90
|
+
action="store_true",
|
91
|
+
help="Remove all FastLED containers and images",
|
92
|
+
)
|
89
93
|
|
90
94
|
build_mode = parser.add_mutually_exclusive_group()
|
91
95
|
build_mode.add_argument("--debug", action="store_true", help="Build in debug mode")
|
@@ -103,6 +107,13 @@ def parse_args() -> argparse.Namespace:
|
|
103
107
|
|
104
108
|
args = parser.parse_args()
|
105
109
|
|
110
|
+
if args.purge:
|
111
|
+
from fastled.docker_manager import DockerManager
|
112
|
+
|
113
|
+
docker = DockerManager()
|
114
|
+
docker.purge(IMAGE_NAME)
|
115
|
+
sys.exit(0)
|
116
|
+
|
106
117
|
if args.init:
|
107
118
|
example = args.init if args.init is not True else None
|
108
119
|
args.directory = project_init(example, args.directory)
|
@@ -122,6 +133,8 @@ def parse_args() -> argparse.Namespace:
|
|
122
133
|
and not args.web
|
123
134
|
and not args.server
|
124
135
|
):
|
136
|
+
from fastled.docker_manager import DockerManager
|
137
|
+
|
125
138
|
if DockerManager.is_docker_installed():
|
126
139
|
if not DockerManager.ensure_linux_containers_for_windows():
|
127
140
|
print(
|
fastled/settings.py
CHANGED
@@ -7,3 +7,7 @@ PLATFORM_TAG: str = "-arm64" if IS_ARM else ""
|
|
7
7
|
CONTAINER_NAME = f"fastled-wasm-compiler{PLATFORM_TAG}"
|
8
8
|
DEFAULT_URL = str(os.environ.get("FASTLED_URL", "https://fastled.onrender.com"))
|
9
9
|
SERVER_PORT = 9021
|
10
|
+
|
11
|
+
IMAGE_NAME = "niteris/fastled-wasm"
|
12
|
+
DEFAULT_CONTAINER_NAME = "fastled-wasm-compiler"
|
13
|
+
# IMAGE_TAG = "main"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: fastled
|
3
|
-
Version: 1.2.
|
3
|
+
Version: 1.2.2
|
4
4
|
Summary: FastLED Wasm Compiler
|
5
5
|
Home-page: https://github.com/zackees/fastled-wasm
|
6
6
|
Maintainer: Zachary Vorhies
|
@@ -262,8 +262,10 @@ A: `delay()` will block `loop()` which blocks the main thread of the browser. Th
|
|
262
262
|
Q: How can I get the compiled size of my FastLED sketch smaller?
|
263
263
|
A: A big chunk of space is being used by unnecessary javascript `emscripten` bundling. The wasm_compiler_settings.py file in the FastLED repo can tweak this.
|
264
264
|
|
265
|
+
|
265
266
|
# Revisions
|
266
267
|
|
268
|
+
* 1.2.22 - Added `--purge` and added docker api at __init__.
|
267
269
|
* 1.2.00 - `fastled.exe` is now a signed binary on windows, however it's a self signed binary so you'll still get the warning on the first open. There's been a small api change between the server and the client for fetching projects.
|
268
270
|
* 1.1.69 - Changed the binary name to `fastled.exe` instead of something like `fastled-windows-x64.exe`
|
269
271
|
* 1.1.68 - Add a site builder to fastled.Test which generates a website with a bunch of demos. This is used to build the demo site automatically.
|
@@ -1,19 +1,19 @@
|
|
1
|
-
fastled/__init__.py,sha256=
|
1
|
+
fastled/__init__.py,sha256=XuiOBb_pqwouDkDxbp5hrYCJLRQo1kHiwVplzj3LYN8,5300
|
2
2
|
fastled/app.py,sha256=Y1Q5mx4zdQbZ2AaB43ZqJo-w_8ehAaWVNtvTyeCRSaE,1970
|
3
3
|
fastled/cli.py,sha256=FjVr31ht0UPlAcmX-84NwfAGMQHTkrCe4o744jCAxiw,375
|
4
4
|
fastled/client_server.py,sha256=8L62zNtkGtErDtWrr4XVNsv7ji2zoS5rlqfCnwI3VKU,13177
|
5
5
|
fastled/compile_server.py,sha256=Z7rHFs3M6QPbSCsbgHAQDk6GTVAJMMPCXtD4Y0mu8RM,2659
|
6
|
-
fastled/compile_server_impl.py,sha256=
|
7
|
-
fastled/docker_manager.py,sha256=
|
6
|
+
fastled/compile_server_impl.py,sha256=B_7zjdKHxX2JbNcx26hntwtk8-MyQTs6LMZlpOEuloM,8746
|
7
|
+
fastled/docker_manager.py,sha256=J6epThU164XAKe8pDsquLs8ytFFn6QAch2PEVeRNY80,26538
|
8
8
|
fastled/filewatcher.py,sha256=LwEQJkqADsArZyY499RLAer6JjJyDwaQBcAvT7xmp3c,6708
|
9
9
|
fastled/keyboard.py,sha256=Zz_ggxOUTX2XQEy6K6kAoorVlUev4wEk9Awpvv9aStA,3241
|
10
10
|
fastled/live_client.py,sha256=_KvqmyUyyGpoYET1Z9CdeUVoIbFjIUWwPcTp5XCQuxY,2075
|
11
11
|
fastled/open_browser.py,sha256=vzMBcpDNY0f-Bx9KmEILKDANZ6gvsywCVwn1FRhPXh4,1770
|
12
|
-
fastled/parse_args.py,sha256=
|
12
|
+
fastled/parse_args.py,sha256=IN63KKFX8uO5h5JSrFtHOFoov6Sw9v41NwB-VitU0No,6579
|
13
13
|
fastled/paths.py,sha256=VsPmgu0lNSCFOoEC0BsTYzDygXqy15AHUfN-tTuzDZA,99
|
14
14
|
fastled/project_init.py,sha256=QEghpy5Vonc_fTF--3L5ySrQ1bDpdJpfnlEHHQLDKRk,2287
|
15
15
|
fastled/select_sketch_directory.py,sha256=TZdCjl1D7YMKjodMTvDRurPcpAmN3x0TcJxffER2NfM,1314
|
16
|
-
fastled/settings.py,sha256=
|
16
|
+
fastled/settings.py,sha256=WwNYzZEGb_fk_25lx03_yIBNGRXWloyRm7FnQhHiJf8,430
|
17
17
|
fastled/sketch.py,sha256=483TrrIdZJfo1MIu5FkD-V5OGmOfHmsZ2f6VvNsJBJM,3299
|
18
18
|
fastled/spinner.py,sha256=VHxmvB92P0Z_zYxRajb5HiNmkHHvZ5dG7hKtZltzpcs,867
|
19
19
|
fastled/string_diff.py,sha256=UR1oRhg9lsPzAG4bn_MwJMCn0evP5AigkBiwLiI9fgA,1354
|
@@ -24,9 +24,9 @@ fastled/assets/example.txt,sha256=lTBovRjiz0_TgtAtbA1C5hNi2ffbqnNPqkKg6UiKCT8,54
|
|
24
24
|
fastled/site/build.py,sha256=UDWaked5QFPibbKZSoDrQgiP1Laoh8f0Fbj8Qfey0I4,12503
|
25
25
|
fastled/test/can_run_local_docker_tests.py,sha256=LEuUbHctRhNNFWcvnz2kEGmjDJeXO4c3kNpizm3yVJs,400
|
26
26
|
fastled/test/examples.py,sha256=6xPwx_k9_XwYTpI1nk4SrYbsJKHJACd30GzD1epGqhY,1597
|
27
|
-
fastled-1.2.
|
28
|
-
fastled-1.2.
|
29
|
-
fastled-1.2.
|
30
|
-
fastled-1.2.
|
31
|
-
fastled-1.2.
|
32
|
-
fastled-1.2.
|
27
|
+
fastled-1.2.2.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
|
28
|
+
fastled-1.2.2.dist-info/METADATA,sha256=sSe6CClj0Y2L_59L4-hsfDeoyYav2rm6pjlF-za1lOw,19341
|
29
|
+
fastled-1.2.2.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
30
|
+
fastled-1.2.2.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
|
31
|
+
fastled-1.2.2.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
|
32
|
+
fastled-1.2.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|