fastled 1.1.29__py2.py3-none-any.whl → 1.1.30__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 CHANGED
@@ -1,3 +1,3 @@
1
1
  """FastLED Wasm Compiler package."""
2
2
 
3
- __version__ = "1.1.29"
3
+ __version__ = "1.1.30"
fastled/app.py CHANGED
@@ -12,6 +12,7 @@ from fastled import __version__
12
12
  from fastled.client_server import run_client_server
13
13
  from fastled.compile_server import CompileServer
14
14
  from fastled.env import DEFAULT_URL
15
+ from fastled.project_init import project_init
15
16
  from fastled.select_sketch_directory import select_sketch_directory
16
17
  from fastled.sketch import (
17
18
  find_sketch_directories,
@@ -33,6 +34,11 @@ def parse_args() -> argparse.Namespace:
33
34
  default=None,
34
35
  help="Directory containing the FastLED sketch to compile",
35
36
  )
37
+ parser.add_argument(
38
+ "--init",
39
+ action="store_true",
40
+ help="Initialize the FastLED sketch in the current directory",
41
+ )
36
42
  parser.add_argument(
37
43
  "--just-compile",
38
44
  action="store_true",
@@ -87,6 +93,7 @@ def parse_args() -> argparse.Namespace:
87
93
  action="store_true",
88
94
  help="Run the server in the current directory, volume mapping fastled if we are in the repo",
89
95
  )
96
+
90
97
  build_mode = parser.add_mutually_exclusive_group()
91
98
  build_mode.add_argument("--debug", action="store_true", help="Build in debug mode")
92
99
  build_mode.add_argument(
@@ -102,6 +109,10 @@ def parse_args() -> argparse.Namespace:
102
109
  cwd_is_fastled = looks_like_fastled_repo(Path(os.getcwd()))
103
110
 
104
111
  args = parser.parse_args()
112
+
113
+ if args.init:
114
+ args.directory = project_init()
115
+
105
116
  if not args.update:
106
117
  if args.no_auto_updates:
107
118
  args.auto_update = False
@@ -0,0 +1,37 @@
1
+ import zipfile
2
+ from pathlib import Path
3
+
4
+ import httpx
5
+
6
+ from fastled.env import DEFAULT_URL
7
+
8
+ ENDPOINT = f"{DEFAULT_URL}/project/init"
9
+
10
+
11
+ def project_init() -> Path:
12
+ """
13
+ Initialize a new FastLED project.
14
+ """
15
+ response = httpx.get(ENDPOINT, timeout=20)
16
+ response.raise_for_status()
17
+ content = response.content
18
+ output = Path("fastled.zip")
19
+ output.write_bytes(content)
20
+ # unzip the content
21
+ outdir = Path("fastled")
22
+ if outdir.exists():
23
+ print("Project already initialized.")
24
+ return Path("fastled").iterdir().__next__()
25
+ with zipfile.ZipFile(output, "r") as zip_ref:
26
+ zip_ref.extractall(outdir)
27
+ print(f"Project initialized successfully at {outdir}")
28
+ output.unlink()
29
+ return Path("fastled").iterdir().__next__()
30
+
31
+
32
+ def unit_test() -> None:
33
+ project_init()
34
+
35
+
36
+ if __name__ == "__main__":
37
+ unit_test()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastled
3
- Version: 1.1.29
3
+ Version: 1.1.30
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.30 - Added `--init` to initialize a demo project.
168
169
  * 1.1.29 - Remove annoying dbg messages i left in.
169
170
  * 1.1.28 - Adds cache control headers to the live server to disable all caching in the live browser.
170
171
  * 1.1.27 - Fixed `--interactive` so that it now works correctly.
@@ -1,5 +1,5 @@
1
- fastled/__init__.py,sha256=lYctXzPgrDxsgVkkhbmwNeN6O7ypfxaV0bZIt-d7bqM,61
2
- fastled/app.py,sha256=oL_IXsYxDRaw9eU2aSkCZ57xAUedbNWT4-WwCsJT2Sc,6978
1
+ fastled/__init__.py,sha256=yLjBvriNeONWn5KKcX1r03E91NonWMYyWdtvyeeo7I8,61
2
+ fastled/app.py,sha256=eKaY6sD8JQ0pz0CZ6rtmhx27xkv5-WteuMYd9HxSeYU,7245
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
5
  fastled/client_server.py,sha256=IK_u71XbmOAKBX1ovHATsCmfUON8VVJJu-XtObTuYJI,11448
@@ -10,6 +10,7 @@ fastled/filewatcher.py,sha256=5dVmjEG23kMeJa29tRVm5XKSr9sTD4ME2boo-CFDuUM,6910
10
10
  fastled/keyboard.py,sha256=Zz_ggxOUTX2XQEy6K6kAoorVlUev4wEk9Awpvv9aStA,3241
11
11
  fastled/open_browser.py,sha256=-2_vyf6dbi2xGex-CMZHVVcXvwXGJkLOwFcjHGxknUQ,1769
12
12
  fastled/paths.py,sha256=VsPmgu0lNSCFOoEC0BsTYzDygXqy15AHUfN-tTuzDZA,99
13
+ fastled/project_init.py,sha256=9GmyaRsXa1fNuzqpv0lcpkSFTOFszpEZ3jr788zZNp0,870
13
14
  fastled/select_sketch_directory.py,sha256=TZdCjl1D7YMKjodMTvDRurPcpAmN3x0TcJxffER2NfM,1314
14
15
  fastled/sketch.py,sha256=5nRjg281lMH8Bo9wKjbcpTQCfEP574ZCG-lukvFmyQ8,2656
15
16
  fastled/spinner.py,sha256=ZGFXona3SJxmuHIzMGa6tqB0IVDSRr8W_dju09Z1Hwg,901
@@ -18,9 +19,9 @@ fastled/types.py,sha256=dDIsGHJkHNJ7B61wNp6X0JSLs_nrHiq7RlNqNWbwFec,194
18
19
  fastled/util.py,sha256=t4M3NFMhnCzfYbLvIyJi0RdFssZqbTN_vVIaej1WV-U,265
19
20
  fastled/web_compile.py,sha256=KuvKGdX6SSUUqC7YgX4T9SMSP5wdcPUhpg9-K9zPoTI,10378
20
21
  fastled/assets/example.txt,sha256=lTBovRjiz0_TgtAtbA1C5hNi2ffbqnNPqkKg6UiKCT8,54
21
- fastled-1.1.29.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
22
- fastled-1.1.29.dist-info/METADATA,sha256=LtpoLOstFU2_ViPEJYvc7o9PiUZpY5pqK_7PeUkDIiU,14482
23
- fastled-1.1.29.dist-info/WHEEL,sha256=0VNUDWQJzfRahYI3neAhz2UVbRCtztpN5dPHAGvmGXc,109
24
- fastled-1.1.29.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
25
- fastled-1.1.29.dist-info/top_level.txt,sha256=xfG6Z_ol9V5YmBROkZq2QTRwjbS2ouCUxaTJsOwfkOo,14
26
- fastled-1.1.29.dist-info/RECORD,,
22
+ fastled-1.1.30.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
23
+ fastled-1.1.30.dist-info/METADATA,sha256=JdbFFpslqjqfeg9SLWlsL1TABA2pCk2pPJFHNIwtqYE,14541
24
+ fastled-1.1.30.dist-info/WHEEL,sha256=0VNUDWQJzfRahYI3neAhz2UVbRCtztpN5dPHAGvmGXc,109
25
+ fastled-1.1.30.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
26
+ fastled-1.1.30.dist-info/top_level.txt,sha256=xfG6Z_ol9V5YmBROkZq2QTRwjbS2ouCUxaTJsOwfkOo,14
27
+ fastled-1.1.30.dist-info/RECORD,,