fastled 1.2.3__py3-none-any.whl → 1.2.5__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/keyboard.py +5 -0
- fastled/parse_args.py +5 -1
- fastled/project_init.py +53 -3
- fastled/site/build.py +3 -3
- {fastled-1.2.3.dist-info → fastled-1.2.5.dist-info}/METADATA +3 -1
- {fastled-1.2.3.dist-info → fastled-1.2.5.dist-info}/RECORD +11 -11
- {fastled-1.2.3.dist-info → fastled-1.2.5.dist-info}/LICENSE +0 -0
- {fastled-1.2.3.dist-info → fastled-1.2.5.dist-info}/WHEEL +0 -0
- {fastled-1.2.3.dist-info → fastled-1.2.5.dist-info}/entry_points.txt +0 -0
- {fastled-1.2.3.dist-info → fastled-1.2.5.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.5"
|
17
17
|
|
18
18
|
|
19
19
|
class Api:
|
fastled/keyboard.py
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import _thread
|
1
2
|
import os
|
2
3
|
import select
|
3
4
|
import sys
|
@@ -69,6 +70,10 @@ class SpaceBarWatcher:
|
|
69
70
|
# Check if there's input ready
|
70
71
|
if select.select([sys.stdin], [], [], 0.1)[0]:
|
71
72
|
char = sys.stdin.read(1)
|
73
|
+
if ord(char) == 3: # ctrl+c on mac, maybe also linux?
|
74
|
+
_thread.interrupt_main()
|
75
|
+
break
|
76
|
+
|
72
77
|
if char in _WHITE_SPACE:
|
73
78
|
self.queue.put(ord(" "))
|
74
79
|
finally:
|
fastled/parse_args.py
CHANGED
@@ -116,7 +116,11 @@ def parse_args() -> argparse.Namespace:
|
|
116
116
|
|
117
117
|
if args.init:
|
118
118
|
example = args.init if args.init is not True else None
|
119
|
-
|
119
|
+
try:
|
120
|
+
args.directory = project_init(example, args.directory)
|
121
|
+
except Exception as e:
|
122
|
+
print(f"Failed to initialize project: {e}")
|
123
|
+
sys.exit(1)
|
120
124
|
print("\nInitialized FastLED project in", args.directory)
|
121
125
|
print(f"Use 'fastled {args.directory}' to compile the project.")
|
122
126
|
sys.exit(0)
|
fastled/project_init.py
CHANGED
@@ -1,9 +1,13 @@
|
|
1
|
+
import _thread
|
2
|
+
import threading
|
3
|
+
import time
|
1
4
|
import zipfile
|
2
5
|
from pathlib import Path
|
3
6
|
|
4
7
|
import httpx
|
5
8
|
|
6
9
|
from fastled.settings import DEFAULT_URL
|
10
|
+
from fastled.spinner import Spinner
|
7
11
|
|
8
12
|
DEFAULT_EXAMPLE = "wasm"
|
9
13
|
|
@@ -34,6 +38,35 @@ def _prompt_for_example() -> str:
|
|
34
38
|
return answer
|
35
39
|
|
36
40
|
|
41
|
+
class DownloadThread(threading.Thread):
|
42
|
+
def __init__(self, url: str, json: str):
|
43
|
+
super().__init__(daemon=True)
|
44
|
+
self.url = url
|
45
|
+
self.json = json
|
46
|
+
self.bytes_downloaded = 0
|
47
|
+
self.content: bytes | None = None
|
48
|
+
self.error: Exception | None = None
|
49
|
+
self.success = False
|
50
|
+
|
51
|
+
def run(self) -> None:
|
52
|
+
timeout = httpx.Timeout(5.0, connect=5.0, read=120.0, write=30.0)
|
53
|
+
try:
|
54
|
+
with httpx.Client(timeout=timeout) as client:
|
55
|
+
with client.stream("POST", self.url, json=self.json) as response:
|
56
|
+
response.raise_for_status()
|
57
|
+
content = b""
|
58
|
+
for chunk in response.iter_bytes():
|
59
|
+
content += chunk
|
60
|
+
self.bytes_downloaded += len(chunk)
|
61
|
+
self.content = content
|
62
|
+
self.success = True
|
63
|
+
except KeyboardInterrupt:
|
64
|
+
self.error = RuntimeError("Download cancelled")
|
65
|
+
_thread.interrupt_main()
|
66
|
+
except Exception as e:
|
67
|
+
self.error = e
|
68
|
+
|
69
|
+
|
37
70
|
def project_init(
|
38
71
|
example: str | None = "PROMPT", # prompt for example
|
39
72
|
outputdir: Path | None = None,
|
@@ -56,9 +89,26 @@ def project_init(
|
|
56
89
|
assert example is not None
|
57
90
|
endpoint_url = f"{host}/project/init"
|
58
91
|
json = example
|
59
|
-
|
60
|
-
|
61
|
-
|
92
|
+
print(f"Initializing project with example '{example}', url={endpoint_url}")
|
93
|
+
|
94
|
+
# Start download thread
|
95
|
+
download_thread = DownloadThread(endpoint_url, json)
|
96
|
+
# spinner = Spinner("Downloading project...")
|
97
|
+
with Spinner(f"Downloading project {example}..."):
|
98
|
+
download_thread.start()
|
99
|
+
while download_thread.is_alive():
|
100
|
+
time.sleep(0.1)
|
101
|
+
|
102
|
+
print() # New line after progress
|
103
|
+
download_thread.join()
|
104
|
+
|
105
|
+
# Check for errors
|
106
|
+
if not download_thread.success:
|
107
|
+
assert download_thread.error is not None
|
108
|
+
raise download_thread.error
|
109
|
+
|
110
|
+
content = download_thread.content
|
111
|
+
assert content is not None
|
62
112
|
tmpzip = outputdir / "fastled.zip"
|
63
113
|
outputdir.mkdir(exist_ok=True)
|
64
114
|
tmpzip.write_bytes(content)
|
fastled/site/build.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: fastled
|
3
|
-
Version: 1.2.
|
3
|
+
Version: 1.2.5
|
4
4
|
Summary: FastLED Wasm Compiler
|
5
5
|
Home-page: https://github.com/zackees/fastled-wasm
|
6
6
|
Maintainer: Zachary Vorhies
|
@@ -266,6 +266,8 @@ A: A big chunk of space is being used by unnecessary javascript `emscripten` bun
|
|
266
266
|
|
267
267
|
# Revisions
|
268
268
|
|
269
|
+
* 1.1.25 - Fix up paths for `--init`
|
270
|
+
* 1.1.24 - Mac/Linux now properly responds to ctrl-c when waiting for a key event.
|
269
271
|
* 1.1.23 - Fixes missing `live-server` on platforms that don't have it already.
|
270
272
|
* 1.2.22 - Added `--purge` and added docker api at __init__.
|
271
273
|
* 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.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
fastled/__init__.py,sha256=
|
1
|
+
fastled/__init__.py,sha256=hCn09t7Zi2h6idcDO0tKMGRnEzotgPzIPaKh6PdEJLM,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
|
@@ -6,12 +6,12 @@ fastled/compile_server.py,sha256=Z7rHFs3M6QPbSCsbgHAQDk6GTVAJMMPCXtD4Y0mu8RM,265
|
|
6
6
|
fastled/compile_server_impl.py,sha256=B_7zjdKHxX2JbNcx26hntwtk8-MyQTs6LMZlpOEuloM,8746
|
7
7
|
fastled/docker_manager.py,sha256=J6epThU164XAKe8pDsquLs8ytFFn6QAch2PEVeRNY80,26538
|
8
8
|
fastled/filewatcher.py,sha256=LwEQJkqADsArZyY499RLAer6JjJyDwaQBcAvT7xmp3c,6708
|
9
|
-
fastled/keyboard.py,sha256=
|
9
|
+
fastled/keyboard.py,sha256=Uwzfgd85BiZTi5D8f3HRQex9cvOuveagUqjULeTEHw4,3423
|
10
10
|
fastled/live_client.py,sha256=_KvqmyUyyGpoYET1Z9CdeUVoIbFjIUWwPcTp5XCQuxY,2075
|
11
11
|
fastled/open_browser.py,sha256=uhx_UkZ4URUcFn--ZOGMacjL6gFZHwnMu2qYyok2YzE,1620
|
12
|
-
fastled/parse_args.py,sha256=
|
12
|
+
fastled/parse_args.py,sha256=nPHmmkr4_izLdrFYFO6_M3JEkL1uO8NThRi29mUPkKw,6707
|
13
13
|
fastled/paths.py,sha256=VsPmgu0lNSCFOoEC0BsTYzDygXqy15AHUfN-tTuzDZA,99
|
14
|
-
fastled/project_init.py,sha256=
|
14
|
+
fastled/project_init.py,sha256=bBt4DwmW5hZkm9ICt9Qk-0Nr_0JQM7icCgH5Iv-bCQs,3984
|
15
15
|
fastled/select_sketch_directory.py,sha256=TZdCjl1D7YMKjodMTvDRurPcpAmN3x0TcJxffER2NfM,1314
|
16
16
|
fastled/settings.py,sha256=WwNYzZEGb_fk_25lx03_yIBNGRXWloyRm7FnQhHiJf8,430
|
17
17
|
fastled/sketch.py,sha256=483TrrIdZJfo1MIu5FkD-V5OGmOfHmsZ2f6VvNsJBJM,3299
|
@@ -21,12 +21,12 @@ fastled/types.py,sha256=PpSEtzFCkWtSIEMC0QXGl966R97vLoryVl3yFW0YhTs,1475
|
|
21
21
|
fastled/util.py,sha256=t4M3NFMhnCzfYbLvIyJi0RdFssZqbTN_vVIaej1WV-U,265
|
22
22
|
fastled/web_compile.py,sha256=05PeLJ77QQC6PUKjDhsntBmyBola6QQIfF2k-zjYNE4,10261
|
23
23
|
fastled/assets/example.txt,sha256=lTBovRjiz0_TgtAtbA1C5hNi2ffbqnNPqkKg6UiKCT8,54
|
24
|
-
fastled/site/build.py,sha256=
|
24
|
+
fastled/site/build.py,sha256=vb1np-3rX5lmPX1Be4OazGtlrsZQYnVDmR2sE4Km7Kw,12536
|
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.5.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
|
28
|
+
fastled-1.2.5.dist-info/METADATA,sha256=oh6UGEkaee1i-kcAAoLjsj4nW3LAPrppoOhAIDroluo,19733
|
29
|
+
fastled-1.2.5.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
30
|
+
fastled-1.2.5.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
|
31
|
+
fastled-1.2.5.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
|
32
|
+
fastled-1.2.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|