fastled 1.2.19__py3-none-any.whl → 1.2.20__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 +2 -2
- fastled/compile_server.py +6 -1
- fastled/open_browser.py +24 -1
- fastled/open_browser2.py +3 -0
- {fastled-1.2.19.dist-info → fastled-1.2.20.dist-info}/METADATA +2 -1
- {fastled-1.2.19.dist-info → fastled-1.2.20.dist-info}/RECORD +10 -10
- {fastled-1.2.19.dist-info → fastled-1.2.20.dist-info}/LICENSE +0 -0
- {fastled-1.2.19.dist-info → fastled-1.2.20.dist-info}/WHEEL +0 -0
- {fastled-1.2.19.dist-info → fastled-1.2.20.dist-info}/entry_points.txt +0 -0
- {fastled-1.2.19.dist-info → fastled-1.2.20.dist-info}/top_level.txt +0 -0
fastled/__init__.py
CHANGED
@@ -15,7 +15,7 @@ from .types import BuildMode, CompileResult, CompileServerError
|
|
15
15
|
# IMPORTANT! There's a bug in github which will REJECT any version update
|
16
16
|
# that has any other change in the repo. Please bump the version as the
|
17
17
|
# ONLY change in a commit, or else the pypi update and the release will fail.
|
18
|
-
__version__ = "1.2.
|
18
|
+
__version__ = "1.2.20"
|
19
19
|
|
20
20
|
|
21
21
|
class Api:
|
@@ -317,7 +317,7 @@ class Test:
|
|
317
317
|
@staticmethod
|
318
318
|
def spawn_http_server(
|
319
319
|
directory: Path | str = Path("."),
|
320
|
-
port: int =
|
320
|
+
port: int | None = None,
|
321
321
|
open_browser: bool = True,
|
322
322
|
) -> Process:
|
323
323
|
from fastled.open_browser import open_browser_process
|
fastled/compile_server.py
CHANGED
@@ -81,7 +81,12 @@ class CompileServer:
|
|
81
81
|
return self.impl._start()
|
82
82
|
|
83
83
|
def stop(self) -> None:
|
84
|
-
|
84
|
+
try:
|
85
|
+
return self.impl.stop()
|
86
|
+
except KeyboardInterrupt:
|
87
|
+
import _thread
|
88
|
+
|
89
|
+
_thread.interrupt_main()
|
85
90
|
|
86
91
|
def process_running(self) -> bool:
|
87
92
|
return self.impl.process_running()
|
fastled/open_browser.py
CHANGED
@@ -36,10 +36,33 @@ def open_http_server_subprocess(
|
|
36
36
|
_thread.interrupt_main()
|
37
37
|
|
38
38
|
|
39
|
+
def is_port_free(port: int) -> bool:
|
40
|
+
"""Check if a port is free"""
|
41
|
+
import socket
|
42
|
+
|
43
|
+
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
44
|
+
return s.connect_ex(("localhost", port)) != 0
|
45
|
+
|
46
|
+
|
47
|
+
def find_free_port(start_port: int) -> int:
|
48
|
+
"""Find a free port starting at start_port"""
|
49
|
+
for port in range(start_port, start_port + 100):
|
50
|
+
if is_port_free(port):
|
51
|
+
print(f"Found free port: {port}")
|
52
|
+
return port
|
53
|
+
else:
|
54
|
+
print(f"Port {port} is in use, finding next")
|
55
|
+
raise ValueError("Could not find a free port")
|
56
|
+
|
57
|
+
|
39
58
|
def open_browser_process(
|
40
|
-
fastled_js: Path, port: int =
|
59
|
+
fastled_js: Path, port: int | None = None, open_browser: bool = True
|
41
60
|
) -> Process:
|
42
61
|
"""Start livereload server in the fastled_js directory and return the process"""
|
62
|
+
if port is not None:
|
63
|
+
if not is_port_free(port):
|
64
|
+
raise ValueError(f"Port {port} was specified but in use in use")
|
65
|
+
port = port or find_free_port(DEFAULT_PORT)
|
43
66
|
out: Process = Process(
|
44
67
|
target=open_http_server_subprocess,
|
45
68
|
args=(fastled_js, port, open_browser),
|
fastled/open_browser2.py
CHANGED
@@ -12,6 +12,9 @@ def _run_flask_server(fastled_js: Path, port: int) -> None:
|
|
12
12
|
|
13
13
|
app = Flask(__name__)
|
14
14
|
|
15
|
+
# Must be a full path or flask will fail to find the file.
|
16
|
+
fastled_js = fastled_js.resolve()
|
17
|
+
|
15
18
|
@app.route("/")
|
16
19
|
def serve_index():
|
17
20
|
return send_from_directory(fastled_js, "index.html")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: fastled
|
3
|
-
Version: 1.2.
|
3
|
+
Version: 1.2.20
|
4
4
|
Summary: FastLED Wasm Compiler
|
5
5
|
Home-page: https://github.com/zackees/fastled-wasm
|
6
6
|
Maintainer: Zachary Vorhies
|
@@ -285,6 +285,7 @@ A: A big chunk of space is being used by unnecessary javascript `emscripten` bun
|
|
285
285
|
|
286
286
|
# Revisions
|
287
287
|
|
288
|
+
* 1.2.20 - Fixed up path issue for web browser launch for hot reload.
|
288
289
|
* 1.2.19 - Compilation failure now overwrites the index.html file with error message.
|
289
290
|
* 1.2.16 - Force mime types in web browser as some users may not have it correct in their registry.
|
290
291
|
* 1.2.15 - Rewrote http server using flask. Reduced install size significantly.
|
@@ -1,15 +1,15 @@
|
|
1
|
-
fastled/__init__.py,sha256=
|
1
|
+
fastled/__init__.py,sha256=k6o-AbU3q4g2JfLBQWBLg3XmnaOgT_af8NtzJU798i4,10750
|
2
2
|
fastled/app.py,sha256=4LQHjN-GMAzhEaIKSFkT5S26Snb1Y9kgVnPK6kqXbrQ,3382
|
3
3
|
fastled/cli.py,sha256=FjVr31ht0UPlAcmX-84NwfAGMQHTkrCe4o744jCAxiw,375
|
4
4
|
fastled/client_server.py,sha256=eORWVyI1PvyowmhLWt3V9aI_AemPSBL9bAkjMBD2kAw,14282
|
5
|
-
fastled/compile_server.py,sha256=
|
5
|
+
fastled/compile_server.py,sha256=g0y9vEZqpzAJEUwketV8lbwI8VZNSSLuOuwcF04k-dw,2775
|
6
6
|
fastled/compile_server_impl.py,sha256=B_7zjdKHxX2JbNcx26hntwtk8-MyQTs6LMZlpOEuloM,8746
|
7
7
|
fastled/docker_manager.py,sha256=Nf0x2BpwT1BvSsi63ZkDhQDMhjiWrjFiXxgowtQMrhM,28955
|
8
8
|
fastled/filewatcher.py,sha256=LwEQJkqADsArZyY499RLAer6JjJyDwaQBcAvT7xmp3c,6708
|
9
9
|
fastled/keyboard.py,sha256=vyYxE98WCXjvMpcUJd0YXPVvt7TzvBmifLYI-K7jtKg,3524
|
10
10
|
fastled/live_client.py,sha256=b9mVJ-8w_zoEDwKIlAEUC5Q1La5W5rR6ct-exOcgJec,2561
|
11
|
-
fastled/open_browser.py,sha256=
|
12
|
-
fastled/open_browser2.py,sha256=
|
11
|
+
fastled/open_browser.py,sha256=7UAtYfnDiLgorWKXq9mDKsnbaX6zPM52dgH4WflH0O4,2624
|
12
|
+
fastled/open_browser2.py,sha256=s1Ph1gIhETRThSiaSsAxfYyavSir57lVxiPm53ZBe3U,4297
|
13
13
|
fastled/parse_args.py,sha256=LD2PpSEhyq3ZqPWa_TJ90Fb-O-yldi7rnen2fWLOPjo,6868
|
14
14
|
fastled/paths.py,sha256=VsPmgu0lNSCFOoEC0BsTYzDygXqy15AHUfN-tTuzDZA,99
|
15
15
|
fastled/project_init.py,sha256=bBt4DwmW5hZkm9ICt9Qk-0Nr_0JQM7icCgH5Iv-bCQs,3984
|
@@ -25,9 +25,9 @@ fastled/assets/example.txt,sha256=lTBovRjiz0_TgtAtbA1C5hNi2ffbqnNPqkKg6UiKCT8,54
|
|
25
25
|
fastled/site/build.py,sha256=l4RajIk0bApiAifT1lyLjIZi9lpPtSba4cnwWP5UOKc,14064
|
26
26
|
fastled/test/can_run_local_docker_tests.py,sha256=LEuUbHctRhNNFWcvnz2kEGmjDJeXO4c3kNpizm3yVJs,400
|
27
27
|
fastled/test/examples.py,sha256=6xPwx_k9_XwYTpI1nk4SrYbsJKHJACd30GzD1epGqhY,1597
|
28
|
-
fastled-1.2.
|
29
|
-
fastled-1.2.
|
30
|
-
fastled-1.2.
|
31
|
-
fastled-1.2.
|
32
|
-
fastled-1.2.
|
33
|
-
fastled-1.2.
|
28
|
+
fastled-1.2.20.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
|
29
|
+
fastled-1.2.20.dist-info/METADATA,sha256=GxfycM_SYG32mAnKNOW6rNhFFKx1Cj2FA7mAHQ1fBPg,20758
|
30
|
+
fastled-1.2.20.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
31
|
+
fastled-1.2.20.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
|
32
|
+
fastled-1.2.20.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
|
33
|
+
fastled-1.2.20.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|