fastled 1.1.27__py2.py3-none-any.whl → 1.1.28__py2.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 +1 -1
- fastled/client_server.py +4 -4
- fastled/open_browser.py +33 -27
- {fastled-1.1.27.dist-info → fastled-1.1.28.dist-info}/METADATA +2 -1
- {fastled-1.1.27.dist-info → fastled-1.1.28.dist-info}/RECORD +9 -9
- {fastled-1.1.27.dist-info → fastled-1.1.28.dist-info}/LICENSE +0 -0
- {fastled-1.1.27.dist-info → fastled-1.1.28.dist-info}/WHEEL +0 -0
- {fastled-1.1.27.dist-info → fastled-1.1.28.dist-info}/entry_points.txt +0 -0
- {fastled-1.1.27.dist-info → fastled-1.1.28.dist-info}/top_level.txt +0 -0
fastled/__init__.py
CHANGED
fastled/client_server.py
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import argparse
|
2
2
|
import shutil
|
3
|
-
import subprocess
|
4
3
|
import tempfile
|
5
4
|
import time
|
5
|
+
from multiprocessing import Process
|
6
6
|
from pathlib import Path
|
7
7
|
|
8
8
|
from fastled.build_mode import BuildMode, get_build_mode
|
@@ -11,7 +11,7 @@ from fastled.docker_manager import DockerManager
|
|
11
11
|
from fastled.env import DEFAULT_URL
|
12
12
|
from fastled.filewatcher import FileWatcherProcess
|
13
13
|
from fastled.keyboard import SpaceBarWatcher
|
14
|
-
from fastled.open_browser import
|
14
|
+
from fastled.open_browser import open_browser_process
|
15
15
|
from fastled.sketch import looks_like_sketch_directory
|
16
16
|
|
17
17
|
# CompiledResult
|
@@ -181,9 +181,9 @@ def run_client_server(args: argparse.Namespace) -> int:
|
|
181
181
|
if not result.success:
|
182
182
|
print("\nCompilation failed.")
|
183
183
|
|
184
|
-
browser_proc:
|
184
|
+
browser_proc: Process | None = None
|
185
185
|
if open_web_browser:
|
186
|
-
browser_proc =
|
186
|
+
browser_proc = open_browser_process(Path(args.directory) / "fastled_js")
|
187
187
|
else:
|
188
188
|
print("\nCompilation successful.")
|
189
189
|
if compile_server:
|
fastled/open_browser.py
CHANGED
@@ -1,35 +1,23 @@
|
|
1
|
+
import os
|
1
2
|
import socket
|
2
|
-
import
|
3
|
+
import sys
|
4
|
+
from multiprocessing import Process
|
3
5
|
from pathlib import Path
|
4
6
|
|
7
|
+
from livereload import Server
|
8
|
+
|
5
9
|
DEFAULT_PORT = 8081
|
6
10
|
|
7
11
|
|
8
|
-
def _open_browser_python(fastled_js: Path, port: int) ->
|
9
|
-
"""Start livereload server in the fastled_js directory using
|
12
|
+
def _open_browser_python(fastled_js: Path, port: int) -> Server:
|
13
|
+
"""Start livereload server in the fastled_js directory using API"""
|
10
14
|
print(f"\nStarting livereload server in {fastled_js} on port {port}")
|
11
15
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
str(port),
|
18
|
-
"-t",
|
19
|
-
str(fastled_js / "index.html"), # file to watch
|
20
|
-
"-w",
|
21
|
-
"0.1", # delay
|
22
|
-
"-o",
|
23
|
-
"0.5", # open browser delay
|
24
|
-
]
|
25
|
-
|
26
|
-
# Start the process
|
27
|
-
process = subprocess.Popen(
|
28
|
-
cmd,
|
29
|
-
# stdout=subprocess.DEVNULL,
|
30
|
-
stderr=subprocess.DEVNULL,
|
31
|
-
)
|
32
|
-
return process
|
16
|
+
server = Server()
|
17
|
+
server.watch(str(fastled_js / "index.html"), delay=0.1)
|
18
|
+
server.setHeader("Cache-Control", "no-cache")
|
19
|
+
server.serve(root=str(fastled_js), port=port, open_url_delay=0.5)
|
20
|
+
return server
|
33
21
|
|
34
22
|
|
35
23
|
def _find_open_port(start_port: int) -> int:
|
@@ -42,11 +30,29 @@ def _find_open_port(start_port: int) -> int:
|
|
42
30
|
port += 1
|
43
31
|
|
44
32
|
|
45
|
-
def
|
46
|
-
"""
|
33
|
+
def _run_server(fastled_js: Path, port: int) -> None:
|
34
|
+
"""Function to run in separate process that starts the livereload server"""
|
35
|
+
sys.stderr = open(os.devnull, "w") # Suppress stderr output
|
36
|
+
_open_browser_python(fastled_js, port)
|
37
|
+
try:
|
38
|
+
# Keep the process running
|
39
|
+
while True:
|
40
|
+
pass
|
41
|
+
except KeyboardInterrupt:
|
42
|
+
print("\nShutting down livereload server...")
|
43
|
+
|
44
|
+
|
45
|
+
def open_browser_process(fastled_js: Path, port: int | None = None) -> Process:
|
46
|
+
"""Start livereload server in the fastled_js directory and return the process"""
|
47
47
|
if port is None:
|
48
48
|
port = DEFAULT_PORT
|
49
49
|
|
50
50
|
port = _find_open_port(port)
|
51
51
|
|
52
|
-
|
52
|
+
process = Process(
|
53
|
+
target=_run_server,
|
54
|
+
args=(fastled_js, port),
|
55
|
+
daemon=True,
|
56
|
+
)
|
57
|
+
process.start()
|
58
|
+
return process
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: fastled
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.1.28
|
4
4
|
Summary: FastLED Wasm Compiler
|
5
5
|
Home-page: https://github.com/zackees/fastled-wasm
|
6
6
|
Maintainer: Zachary Vorhies
|
@@ -165,6 +165,7 @@ A: A big chunk of space is being used by unnecessary javascript `emscripten` is
|
|
165
165
|
|
166
166
|
# Revisions
|
167
167
|
|
168
|
+
* 1.1.28 - Adds cache control headers to the live server to disable all caching in the live browser.
|
168
169
|
* 1.1.27 - Fixed `--interactive` so that it now works correctly.
|
169
170
|
* 1.1.25 - Improved detecting which sketch directory the user means by fuzzy matching.
|
170
171
|
* 1.1.24 - Adds progress spinning bar for pulling images, which take a long time.
|
@@ -1,14 +1,14 @@
|
|
1
|
-
fastled/__init__.py,sha256=
|
1
|
+
fastled/__init__.py,sha256=HMXRAUlJ0qqTwg5n-j-Bgndq0EzWjp-bqu6VcSiNeq4,61
|
2
2
|
fastled/app.py,sha256=oL_IXsYxDRaw9eU2aSkCZ57xAUedbNWT4-WwCsJT2Sc,6978
|
3
3
|
fastled/build_mode.py,sha256=joMwsV4K1y_LijT4gEAcjx69RZBoe_KmFmHZdPYbL_4,631
|
4
4
|
fastled/cli.py,sha256=CNR_pQR0sNVPNuv8e_nmm-0PI8sU-eUBUgnWgWkzW9c,237
|
5
|
-
fastled/client_server.py,sha256=
|
5
|
+
fastled/client_server.py,sha256=IK_u71XbmOAKBX1ovHATsCmfUON8VVJJu-XtObTuYJI,11448
|
6
6
|
fastled/compile_server.py,sha256=Adb2lvJ_p6Ui7UMxijRtYJhbO4YPTERKVQeuoQgibSE,6724
|
7
7
|
fastled/docker_manager.py,sha256=Ok8TC1JXMoNMWt4P9clFFEVE29Xd-4C_MvIMIfvNo78,22134
|
8
8
|
fastled/env.py,sha256=8wctQwl5qE4CI8NBugHtgMmUfEfHZ869JX5lGdSOJxc,304
|
9
9
|
fastled/filewatcher.py,sha256=5dVmjEG23kMeJa29tRVm5XKSr9sTD4ME2boo-CFDuUM,6910
|
10
10
|
fastled/keyboard.py,sha256=Zz_ggxOUTX2XQEy6K6kAoorVlUev4wEk9Awpvv9aStA,3241
|
11
|
-
fastled/open_browser.py,sha256
|
11
|
+
fastled/open_browser.py,sha256=-2_vyf6dbi2xGex-CMZHVVcXvwXGJkLOwFcjHGxknUQ,1769
|
12
12
|
fastled/paths.py,sha256=VsPmgu0lNSCFOoEC0BsTYzDygXqy15AHUfN-tTuzDZA,99
|
13
13
|
fastled/select_sketch_directory.py,sha256=TZdCjl1D7YMKjodMTvDRurPcpAmN3x0TcJxffER2NfM,1314
|
14
14
|
fastled/sketch.py,sha256=5nRjg281lMH8Bo9wKjbcpTQCfEP574ZCG-lukvFmyQ8,2656
|
@@ -18,9 +18,9 @@ fastled/types.py,sha256=dDIsGHJkHNJ7B61wNp6X0JSLs_nrHiq7RlNqNWbwFec,194
|
|
18
18
|
fastled/util.py,sha256=t4M3NFMhnCzfYbLvIyJi0RdFssZqbTN_vVIaej1WV-U,265
|
19
19
|
fastled/web_compile.py,sha256=KuvKGdX6SSUUqC7YgX4T9SMSP5wdcPUhpg9-K9zPoTI,10378
|
20
20
|
fastled/assets/example.txt,sha256=lTBovRjiz0_TgtAtbA1C5hNi2ffbqnNPqkKg6UiKCT8,54
|
21
|
-
fastled-1.1.
|
22
|
-
fastled-1.1.
|
23
|
-
fastled-1.1.
|
24
|
-
fastled-1.1.
|
25
|
-
fastled-1.1.
|
26
|
-
fastled-1.1.
|
21
|
+
fastled-1.1.28.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
|
22
|
+
fastled-1.1.28.dist-info/METADATA,sha256=j1WPsQq5G-YdMkuogYjcJKvO-X75I3Fo5oarOa-hTXA,14428
|
23
|
+
fastled-1.1.28.dist-info/WHEEL,sha256=0VNUDWQJzfRahYI3neAhz2UVbRCtztpN5dPHAGvmGXc,109
|
24
|
+
fastled-1.1.28.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
|
25
|
+
fastled-1.1.28.dist-info/top_level.txt,sha256=xfG6Z_ol9V5YmBROkZq2QTRwjbS2ouCUxaTJsOwfkOo,14
|
26
|
+
fastled-1.1.28.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|