fastled 1.1.30__py2.py3-none-any.whl → 1.1.31__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/app.py +64 -217
- fastled/docker_manager.py +590 -582
- fastled/parse_args.py +161 -0
- {fastled-1.1.30.dist-info → fastled-1.1.31.dist-info}/METADATA +2 -3
- {fastled-1.1.30.dist-info → fastled-1.1.31.dist-info}/RECORD +10 -9
- {fastled-1.1.30.dist-info → fastled-1.1.31.dist-info}/LICENSE +0 -0
- {fastled-1.1.30.dist-info → fastled-1.1.31.dist-info}/WHEEL +0 -0
- {fastled-1.1.30.dist-info → fastled-1.1.31.dist-info}/entry_points.txt +0 -0
- {fastled-1.1.30.dist-info → fastled-1.1.31.dist-info}/top_level.txt +0 -0
fastled/parse_args.py
ADDED
@@ -0,0 +1,161 @@
|
|
1
|
+
import argparse
|
2
|
+
import os
|
3
|
+
import sys
|
4
|
+
from pathlib import Path
|
5
|
+
|
6
|
+
from fastled import __version__
|
7
|
+
from fastled.docker_manager import DockerManager
|
8
|
+
from fastled.env import DEFAULT_URL
|
9
|
+
from fastled.project_init import project_init
|
10
|
+
from fastled.select_sketch_directory import select_sketch_directory
|
11
|
+
from fastled.sketch import (
|
12
|
+
find_sketch_directories,
|
13
|
+
looks_like_fastled_repo,
|
14
|
+
looks_like_sketch_directory,
|
15
|
+
)
|
16
|
+
|
17
|
+
|
18
|
+
def parse_args() -> argparse.Namespace:
|
19
|
+
"""Parse command-line arguments."""
|
20
|
+
parser = argparse.ArgumentParser(description=f"FastLED WASM Compiler {__version__}")
|
21
|
+
parser.add_argument(
|
22
|
+
"--version", action="version", version=f"%(prog)s {__version__}"
|
23
|
+
)
|
24
|
+
parser.add_argument(
|
25
|
+
"directory",
|
26
|
+
type=str,
|
27
|
+
nargs="?",
|
28
|
+
default=None,
|
29
|
+
help="Directory containing the FastLED sketch to compile",
|
30
|
+
)
|
31
|
+
parser.add_argument(
|
32
|
+
"--init",
|
33
|
+
action="store_true",
|
34
|
+
help="Initialize the FastLED sketch in the current directory",
|
35
|
+
)
|
36
|
+
parser.add_argument(
|
37
|
+
"--just-compile",
|
38
|
+
action="store_true",
|
39
|
+
help="Just compile, skip opening the browser and watching for changes.",
|
40
|
+
)
|
41
|
+
parser.add_argument(
|
42
|
+
"--web",
|
43
|
+
"-w",
|
44
|
+
type=str,
|
45
|
+
nargs="?",
|
46
|
+
# const does not seem to be working as expected
|
47
|
+
const=DEFAULT_URL, # Default value when --web is specified without value
|
48
|
+
help="Use web compiler. Optional URL can be provided (default: https://fastled.onrender.com)",
|
49
|
+
)
|
50
|
+
parser.add_argument(
|
51
|
+
"-i",
|
52
|
+
"--interactive",
|
53
|
+
action="store_true",
|
54
|
+
help="Run in interactive mode (Not available with --web)",
|
55
|
+
)
|
56
|
+
parser.add_argument(
|
57
|
+
"--profile",
|
58
|
+
action="store_true",
|
59
|
+
help="Enable profiling for web compilation",
|
60
|
+
)
|
61
|
+
parser.add_argument(
|
62
|
+
"--force-compile",
|
63
|
+
action="store_true",
|
64
|
+
help="Skips the test to see if the current directory is a valid FastLED sketch directory",
|
65
|
+
)
|
66
|
+
parser.add_argument(
|
67
|
+
"--no-auto-updates",
|
68
|
+
action="store_true",
|
69
|
+
help="Disable automatic updates of the wasm compiler image when using docker.",
|
70
|
+
)
|
71
|
+
parser.add_argument(
|
72
|
+
"--update",
|
73
|
+
"--upgrade",
|
74
|
+
action="store_true",
|
75
|
+
help="Update the wasm compiler (if necessary) before running",
|
76
|
+
)
|
77
|
+
parser.add_argument(
|
78
|
+
"--localhost",
|
79
|
+
"--local",
|
80
|
+
"-l",
|
81
|
+
action="store_true",
|
82
|
+
help="Use localhost for web compilation from an instance of fastled --server, creating it if necessary",
|
83
|
+
)
|
84
|
+
parser.add_argument(
|
85
|
+
"--server",
|
86
|
+
"-s",
|
87
|
+
action="store_true",
|
88
|
+
help="Run the server in the current directory, volume mapping fastled if we are in the repo",
|
89
|
+
)
|
90
|
+
|
91
|
+
build_mode = parser.add_mutually_exclusive_group()
|
92
|
+
build_mode.add_argument("--debug", action="store_true", help="Build in debug mode")
|
93
|
+
build_mode.add_argument(
|
94
|
+
"--quick",
|
95
|
+
action="store_true",
|
96
|
+
default=True,
|
97
|
+
help="Build in quick mode (default)",
|
98
|
+
)
|
99
|
+
build_mode.add_argument(
|
100
|
+
"--release", action="store_true", help="Build in release mode"
|
101
|
+
)
|
102
|
+
|
103
|
+
cwd_is_fastled = looks_like_fastled_repo(Path(os.getcwd()))
|
104
|
+
|
105
|
+
args = parser.parse_args()
|
106
|
+
|
107
|
+
if args.init:
|
108
|
+
args.directory = project_init()
|
109
|
+
|
110
|
+
if not args.update:
|
111
|
+
if args.no_auto_updates:
|
112
|
+
args.auto_update = False
|
113
|
+
else:
|
114
|
+
args.auto_update = None
|
115
|
+
|
116
|
+
if (
|
117
|
+
not cwd_is_fastled
|
118
|
+
and not args.localhost
|
119
|
+
and not args.web
|
120
|
+
and not args.server
|
121
|
+
):
|
122
|
+
# print(f"Using web compiler at {DEFAULT_URL}")
|
123
|
+
args.web = DEFAULT_URL
|
124
|
+
if DockerManager.is_docker_installed():
|
125
|
+
print("Docker is installed. Use --server to run the compiler locally.")
|
126
|
+
args.localhost = True
|
127
|
+
else:
|
128
|
+
print("Docker is not installed. Using web compiler.")
|
129
|
+
if cwd_is_fastled and not args.web and not args.server:
|
130
|
+
print("Forcing --local mode because we are in the FastLED repo")
|
131
|
+
args.localhost = True
|
132
|
+
if args.localhost:
|
133
|
+
args.web = "localhost"
|
134
|
+
if args.interactive and not args.server:
|
135
|
+
print("--interactive forces --server mode")
|
136
|
+
args.server = True
|
137
|
+
if args.directory is None and not args.server:
|
138
|
+
# does current directory look like a sketch?
|
139
|
+
maybe_sketch_dir = Path(os.getcwd())
|
140
|
+
if looks_like_sketch_directory(maybe_sketch_dir):
|
141
|
+
args.directory = str(maybe_sketch_dir)
|
142
|
+
else:
|
143
|
+
sketch_directories = find_sketch_directories(maybe_sketch_dir)
|
144
|
+
selected_dir = select_sketch_directory(
|
145
|
+
sketch_directories, cwd_is_fastled
|
146
|
+
)
|
147
|
+
if selected_dir:
|
148
|
+
print(f"Using sketch directory: {selected_dir}")
|
149
|
+
args.directory = selected_dir
|
150
|
+
else:
|
151
|
+
print(
|
152
|
+
"\nYou either need to specify a sketch directory or run in --server mode."
|
153
|
+
)
|
154
|
+
sys.exit(1)
|
155
|
+
elif args.directory is not None and os.path.isfile(args.directory):
|
156
|
+
dir_path = Path(args.directory).parent
|
157
|
+
if looks_like_sketch_directory(dir_path):
|
158
|
+
print(f"Using sketch directory: {dir_path}")
|
159
|
+
args.directory = str(dir_path)
|
160
|
+
|
161
|
+
return args
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: fastled
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.1.31
|
4
4
|
Summary: FastLED Wasm Compiler
|
5
5
|
Home-page: https://github.com/zackees/fastled-wasm
|
6
6
|
Maintainer: Zachary Vorhies
|
@@ -161,10 +161,9 @@ A: `delay()` will block `loop()` which blocks the main thread of the browser. Th
|
|
161
161
|
Q: How can I get the compiled size of my FastLED sketch smaller?
|
162
162
|
A: A big chunk of space is being used by unnecessary javascript `emscripten` is bundling. This can be tweeked by the wasm_compiler_settings.py file in the FastLED repo.
|
163
163
|
|
164
|
-
|
165
|
-
|
166
164
|
# Revisions
|
167
165
|
|
166
|
+
* 1.1.31 - `--local` is auto-enabled if docker is installed, use `--web` to force web compiler. Updating is much more pretty.
|
168
167
|
* 1.1.30 - Added `--init` to initialize a demo project.
|
169
168
|
* 1.1.29 - Remove annoying dbg messages i left in.
|
170
169
|
* 1.1.28 - Adds cache control headers to the live server to disable all caching in the live browser.
|
@@ -1,14 +1,15 @@
|
|
1
|
-
fastled/__init__.py,sha256=
|
2
|
-
fastled/app.py,sha256=
|
1
|
+
fastled/__init__.py,sha256=6jxxjP0Xri7C6EmI1qL3wfS_HKvFbZP2OMpSiZipIo8,61
|
2
|
+
fastled/app.py,sha256=Zw1RS72yyIZSDt1_08MDSzfY4YwLWzarwXM4nvy8GE4,1787
|
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
|
6
6
|
fastled/compile_server.py,sha256=Adb2lvJ_p6Ui7UMxijRtYJhbO4YPTERKVQeuoQgibSE,6724
|
7
|
-
fastled/docker_manager.py,sha256=
|
7
|
+
fastled/docker_manager.py,sha256=WVWg8ABWjdrX1P4vRRbW2z6yMOhhrHVtQ9H_cBBBAlI,23275
|
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
11
|
fastled/open_browser.py,sha256=-2_vyf6dbi2xGex-CMZHVVcXvwXGJkLOwFcjHGxknUQ,1769
|
12
|
+
fastled/parse_args.py,sha256=2O6lB6Nf0ZfNv10AHFK3fkN35DCrpX4dBByZa0u6XR4,5537
|
12
13
|
fastled/paths.py,sha256=VsPmgu0lNSCFOoEC0BsTYzDygXqy15AHUfN-tTuzDZA,99
|
13
14
|
fastled/project_init.py,sha256=9GmyaRsXa1fNuzqpv0lcpkSFTOFszpEZ3jr788zZNp0,870
|
14
15
|
fastled/select_sketch_directory.py,sha256=TZdCjl1D7YMKjodMTvDRurPcpAmN3x0TcJxffER2NfM,1314
|
@@ -19,9 +20,9 @@ fastled/types.py,sha256=dDIsGHJkHNJ7B61wNp6X0JSLs_nrHiq7RlNqNWbwFec,194
|
|
19
20
|
fastled/util.py,sha256=t4M3NFMhnCzfYbLvIyJi0RdFssZqbTN_vVIaej1WV-U,265
|
20
21
|
fastled/web_compile.py,sha256=KuvKGdX6SSUUqC7YgX4T9SMSP5wdcPUhpg9-K9zPoTI,10378
|
21
22
|
fastled/assets/example.txt,sha256=lTBovRjiz0_TgtAtbA1C5hNi2ffbqnNPqkKg6UiKCT8,54
|
22
|
-
fastled-1.1.
|
23
|
-
fastled-1.1.
|
24
|
-
fastled-1.1.
|
25
|
-
fastled-1.1.
|
26
|
-
fastled-1.1.
|
27
|
-
fastled-1.1.
|
23
|
+
fastled-1.1.31.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
|
24
|
+
fastled-1.1.31.dist-info/METADATA,sha256=Q4cS70DetU08f-0-GUc6CxTrCI3R9FJArBszGUA7r_I,14666
|
25
|
+
fastled-1.1.31.dist-info/WHEEL,sha256=0VNUDWQJzfRahYI3neAhz2UVbRCtztpN5dPHAGvmGXc,109
|
26
|
+
fastled-1.1.31.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
|
27
|
+
fastled-1.1.31.dist-info/top_level.txt,sha256=xfG6Z_ol9V5YmBROkZq2QTRwjbS2ouCUxaTJsOwfkOo,14
|
28
|
+
fastled-1.1.31.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|