fastled 1.2.11__py3-none-any.whl → 1.2.13__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 CHANGED
@@ -14,7 +14,7 @@ from .types import BuildMode, CompileResult, CompileServerError
14
14
  # IMPORTANT! There's a bug in github which will REJECT any version update
15
15
  # that has any other change in the repo. Please bump the version as the
16
16
  # ONLY change in a commit, or else the pypi update and the release will fail.
17
- __version__ = "1.2.11"
17
+ __version__ = "1.2.13"
18
18
 
19
19
 
20
20
  class Api:
fastled/open_browser.py CHANGED
@@ -1,30 +1,57 @@
1
1
  import shutil
2
2
  import socket
3
3
  import subprocess
4
- import sys
5
4
  from multiprocessing import Process
6
5
  from pathlib import Path
7
6
 
7
+ from static_npm import Npm, Npx
8
+ from static_npm.paths import CACHE_DIR
9
+ from static_npm.running_process import RunningProcess
10
+
8
11
  DEFAULT_PORT = 8081
9
12
 
10
13
 
11
14
  def open_http_server(
12
15
  fastled_js: Path, port: int | None = None, open_browser=True
13
- ) -> subprocess.Popen:
16
+ ) -> subprocess.Popen | RunningProcess:
14
17
  """Start livereload server in the fastled_js directory using API"""
15
18
  cmd_list: list[str]
16
19
  print(f"\nStarting livereload server in {fastled_js}")
17
- if shutil.which("live-server") is None:
18
- print("live-server not found. Installing it with the embedded npm...")
19
- cmd_list = [sys.executable, "-m", "npm", "install", "-g", "live-server"]
20
- subprocess.run(cmd_list)
20
+
21
21
  cmd_list = ["live-server"]
22
22
  if port is not None:
23
23
  cmd_list.extend([f"--port={port}"])
24
24
  if not open_browser:
25
25
  cmd_list.append("--no-browser")
26
- # subprocess.run(["cd", str(fastled_js), "&&"] + cmd_list)
27
- return subprocess.Popen(cmd_list, cwd=str(fastled_js), shell=True)
26
+
27
+ live_server_where = shutil.which("live-server")
28
+ if live_server_where is None:
29
+ print("live-server not found. Installing it with the embedded npm...")
30
+ # cmd_list = [sys.executable, "-m", "nodejs.npm", "install", "-g", "live-server"]
31
+ # npm.call("install -g live-server --force --legacy-peer-deps")
32
+ tool_dir = CACHE_DIR / "live-server"
33
+ npm = Npm()
34
+ npx = Npx()
35
+ npm.run(["install", "live-server", "--prefix", tool_dir])
36
+ # npm.run(["install", "live-server", "--prefix", str(tool_dir)])
37
+ cmd_str = subprocess.list2cmdline(
38
+ ["npx"] + ["--prefix", str(tool_dir)] + cmd_list
39
+ )
40
+ print(f"Running: {cmd_str}")
41
+ proc = npx.run(["--prefix", str(tool_dir)] + cmd_list, cwd=fastled_js)
42
+ return proc # type ignore
43
+ else:
44
+ # npx.run("live-server", check=False)
45
+ # subprocess.run(cmd_list)
46
+ live_server_where = shutil.which("live-server")
47
+ print(f"Using live-server from {live_server_where}")
48
+ cmd_list = ["live-server"]
49
+ if port is not None:
50
+ cmd_list.extend([f"--port={port}"])
51
+ if not open_browser:
52
+ cmd_list.append("--no-browser")
53
+ # subprocess.run(["cd", str(fastled_js), "&&"] + cmd_list)
54
+ return subprocess.Popen(cmd_list, cwd=str(fastled_js), shell=True)
28
55
 
29
56
 
30
57
  def _open_browser_python(fastled_js: Path) -> None:
fastled/site/build.py CHANGED
@@ -71,7 +71,7 @@ body {
71
71
  position: fixed;
72
72
  left: var(--spacing-md);
73
73
  top: var(--spacing-md);
74
- padding: var(--spacing-sm) var(--spacing-lg);
74
+ padding: 15px 30px;
75
75
  z-index: 1001;
76
76
  background-color: var(--color-surface);
77
77
  border-radius: var(--border-radius);
@@ -80,7 +80,7 @@ body {
80
80
  justify-content: center;
81
81
  cursor: pointer;
82
82
  color: var(--color-text);
83
- font-size: 16px;
83
+ font-size: 24px;
84
84
  transition: background-color var(--transition-speed) ease;
85
85
  }
86
86
 
@@ -88,6 +88,15 @@ body {
88
88
  background-color: var(--color-surface-transparent);
89
89
  }
90
90
 
91
+ .nav-trigger .fa-chevron-down {
92
+ margin-left: 10px;
93
+ transition: transform var(--transition-speed) ease;
94
+ }
95
+
96
+ .nav-pane.visible + .nav-trigger .fa-chevron-down {
97
+ transform: rotate(180deg);
98
+ }
99
+
91
100
  .nav-pane {
92
101
  position: fixed;
93
102
  left: var(--spacing-md);
@@ -176,7 +185,7 @@ INDEX_TEMPLATE = """<!DOCTYPE html>
176
185
  <div class="splash-text">FastLED</div>
177
186
  </div>
178
187
  <div class="content-wrapper">
179
- <div class="nav-trigger">Examples</div>
188
+ <div class="nav-trigger">Examples <i class="fas fa-chevron-down"></i></div>
180
189
  <nav class="nav-pane">
181
190
  {example_links}
182
191
  </nav>
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastled
3
- Version: 1.2.11
3
+ Version: 1.2.13
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
7
7
  License: BSD 3-Clause License
8
8
  Keywords: template-python-cmd
9
9
  Classifier: Programming Language :: Python :: 3
10
- Requires-Python: >=3.9
10
+ Requires-Python: >=3.10
11
11
  Description-Content-Type: text/markdown
12
12
  License-File: LICENSE
13
13
  Requires-Dist: docker>=7.1.0
@@ -19,7 +19,7 @@ Requires-Dist: disklru>=2.0.1
19
19
  Requires-Dist: appdirs>=1.4.4
20
20
  Requires-Dist: rapidfuzz>=3.10.1
21
21
  Requires-Dist: progress>=1.6
22
- Requires-Dist: nodejs-bin[cmd]
22
+ Requires-Dist: static-npm>=1.0.6
23
23
 
24
24
  # FastLED Wasm compiler
25
25
 
@@ -54,6 +54,17 @@ In every conceivable way, the local compiler will be much faster than the web ve
54
54
 
55
55
  https://zackees.github.io/fastled-wasm/
56
56
 
57
+ # Install
58
+
59
+ `pip install fastled`
60
+
61
+ # Run
62
+
63
+ ```bash
64
+ cd mysketchdirectory
65
+ fastled
66
+ ```
67
+
57
68
  # Tutorial video
58
69
 
59
70
  **Note this video is a little outdated, you will install the app now with `pip install fastled` and run it like `fastled mysketchfolder`**
@@ -271,9 +282,10 @@ A: `delay()` will block `loop()` which blocks the main thread of the browser. Th
271
282
  Q: How can I get the compiled size of my FastLED sketch smaller?
272
283
  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.
273
284
 
274
-
275
285
  # Revisions
276
286
 
287
+ * 1.2.13 - More fixes for npm live-server, now uses `static-npm` to launch it.
288
+ * 1.2.12 - Fixes for python npm for launching live-server
277
289
  * 1.2.10 - `fastled.Test` now allows you to spawn the http webserver on a folder with an index.html in it.
278
290
  * 1.2.7 - A bunch of fixes for MacOS and probably linux.
279
291
  * 1.2.6 - Now builds image from the project root of FastLED.
@@ -1,4 +1,4 @@
1
- fastled/__init__.py,sha256=n_6k2u1TLsYFc6Ke6DHb00-R_WeXIglYeN7qwWGvy8c,10717
1
+ fastled/__init__.py,sha256=I3PIvRPAPDQk2klTJxzpwuGcuC-wVqz7XnImK5xGweY,10717
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=8L62zNtkGtErDtWrr4XVNsv7ji2zoS5rlqfCnwI3VKU,13177
@@ -8,7 +8,7 @@ fastled/docker_manager.py,sha256=Nf0x2BpwT1BvSsi63ZkDhQDMhjiWrjFiXxgowtQMrhM,289
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=9H1eA47FUFyozjGfwLJsiuEUsuP9sPXH_3egb89g_BA,2026
11
+ fastled/open_browser.py,sha256=FrEwPER1mxDiK1zHvKFwpcJ1neespg7dX60DrW6f5Lk,3140
12
12
  fastled/parse_args.py,sha256=LD2PpSEhyq3ZqPWa_TJ90Fb-O-yldi7rnen2fWLOPjo,6868
13
13
  fastled/paths.py,sha256=VsPmgu0lNSCFOoEC0BsTYzDygXqy15AHUfN-tTuzDZA,99
14
14
  fastled/project_init.py,sha256=bBt4DwmW5hZkm9ICt9Qk-0Nr_0JQM7icCgH5Iv-bCQs,3984
@@ -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=Eq_u3oRxP88twv5IskKfH3tMr6IuT3I5C5zl94TUECw,13854
24
+ fastled/site/build.py,sha256=l4RajIk0bApiAifT1lyLjIZi9lpPtSba4cnwWP5UOKc,14064
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.11.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
28
- fastled-1.2.11.dist-info/METADATA,sha256=AudnTCOBm01DCojEpMqBTYulE_I9G0eo2R4uX3uPYKQ,20192
29
- fastled-1.2.11.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
30
- fastled-1.2.11.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
31
- fastled-1.2.11.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
32
- fastled-1.2.11.dist-info/RECORD,,
27
+ fastled-1.2.13.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
28
+ fastled-1.2.13.dist-info/METADATA,sha256=UOTyndKstydJeWYJk1K_eGqchIx_ki0so4U0K2CCoPI,20418
29
+ fastled-1.2.13.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
30
+ fastled-1.2.13.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
31
+ fastled-1.2.13.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
32
+ fastled-1.2.13.dist-info/RECORD,,