fastled 1.2.34__tar.gz → 1.2.36__tar.gz
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-1.2.34 → fastled-1.2.36}/PKG-INFO +1 -1
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/__init__.py +1 -1
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/app.py +6 -14
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/client_server.py +3 -3
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/parse_args.py +27 -4
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/sketch.py +4 -1
- fastled-1.2.36/src/fastled/types.py +146 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled.egg-info/PKG-INFO +1 -1
- fastled-1.2.34/src/fastled/types.py +0 -61
- {fastled-1.2.34 → fastled-1.2.36}/.aiderignore +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/.github/workflows/build_multi_docker_image.yml +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/.github/workflows/build_webpage.yml +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/.github/workflows/lint.yml +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/.github/workflows/publish_release.yml +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/.github/workflows/test_build_exe.yml +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/.github/workflows/test_macos.yml +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/.github/workflows/test_ubuntu.yml +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/.github/workflows/test_win.yml +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/.gitignore +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/.pylintrc +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/.vscode/launch.json +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/.vscode/settings.json +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/.vscode/tasks.json +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/LICENSE +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/MANIFEST.in +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/README.md +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/RELEASE.md +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/TODO.md +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/build_exe.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/build_site.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/clean +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/install +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/install_linux.sh +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/lint +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/pyproject.toml +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/requirements.testing.txt +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/setup.cfg +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/setup.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/assets/example.txt +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/cli.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/compile_server.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/compile_server_impl.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/docker_manager.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/filewatcher.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/keyboard.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/live_client.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/open_browser.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/open_browser2.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/paths.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/project_init.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/select_sketch_directory.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/settings.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/site/build.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/spinner.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/string_diff.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/test/can_run_local_docker_tests.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/test/examples.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/util.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled/web_compile.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled.egg-info/SOURCES.txt +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled.egg-info/dependency_links.txt +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled.egg-info/entry_points.txt +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled.egg-info/requires.txt +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/src/fastled.egg-info/top_level.txt +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/test +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/html/index.html +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/test_api.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/test_bad_ino.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/test_build.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/test_build_examples.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/test_build_from_docker.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/test_build_from_github.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/test_cli.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/test_compile_server.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/test_docker_linux_on_windows.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/test_embedded_data.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/test_examples.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/test_filechanger.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/test_http_server.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/test_ino/bad/bad.ino +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/test_ino/bad_platformio/bad_platformio.ino +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/test_ino/bad_platformio/platformio.ini +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/test_ino/embedded/data/bigdata.dat +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/test_ino/embedded/wasm.ino +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/test_ino/wasm/wasm.ino +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/test_project_init.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/test_server_and_client_seperatly.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/tests/test_webcompile.py +0 -0
- {fastled-1.2.34 → fastled-1.2.36}/upload_package.sh +0 -0
@@ -16,7 +16,7 @@ from .types import BuildMode, CompileResult, CompileServerError
|
|
16
16
|
# IMPORTANT! There's a bug in github which will REJECT any version update
|
17
17
|
# that has any other change in the repo. Please bump the version as the
|
18
18
|
# ONLY change in a commit, or else the pypi update and the release will fail.
|
19
|
-
__version__ = "1.2.
|
19
|
+
__version__ = "1.2.36"
|
20
20
|
|
21
21
|
|
22
22
|
class Api:
|
@@ -2,7 +2,6 @@
|
|
2
2
|
Uses the latest wasm compiler image to compile the FastLED sketch.
|
3
3
|
"""
|
4
4
|
|
5
|
-
import argparse
|
6
5
|
import sys
|
7
6
|
import time
|
8
7
|
from pathlib import Path
|
@@ -10,10 +9,10 @@ from pathlib import Path
|
|
10
9
|
from fastled.client_server import run_client_server
|
11
10
|
from fastled.compile_server import CompileServer
|
12
11
|
from fastled.filewatcher import file_watcher_set
|
13
|
-
from fastled.parse_args import parse_args
|
12
|
+
from fastled.parse_args import Args, parse_args
|
14
13
|
|
15
14
|
|
16
|
-
def run_server(args:
|
15
|
+
def run_server(args: Args) -> int:
|
17
16
|
interactive = args.interactive
|
18
17
|
auto_update = args.auto_update
|
19
18
|
mapped_dir = Path(args.directory).absolute() if args.directory else None
|
@@ -46,20 +45,13 @@ def run_server(args: argparse.Namespace) -> int:
|
|
46
45
|
def main() -> int:
|
47
46
|
args = parse_args()
|
48
47
|
interactive: bool = args.interactive
|
49
|
-
|
48
|
+
has_server = args.server
|
50
49
|
update: bool = args.update
|
51
50
|
build: bool = args.build
|
52
51
|
just_compile: bool = args.just_compile
|
53
52
|
# directory: Path | None = Path(args.directory).absolute() if args.directory else None
|
54
53
|
directory: Path | None = Path(args.directory) if args.directory else None
|
55
54
|
|
56
|
-
# broken for now
|
57
|
-
if directory is None and interactive:
|
58
|
-
# if examples/wasm exists
|
59
|
-
if Path("examples/wasm").exists():
|
60
|
-
print(f"Using {Path('examples/wasm')} as the sketch directory")
|
61
|
-
directory = Path("examples/wasm").absolute()
|
62
|
-
|
63
55
|
if update:
|
64
56
|
# Force auto_update to ensure update check happens
|
65
57
|
compile_server = CompileServer(interactive=False, auto_updates=True)
|
@@ -103,7 +95,7 @@ def main() -> int:
|
|
103
95
|
print("\nExiting from client...")
|
104
96
|
return 1
|
105
97
|
|
106
|
-
if
|
98
|
+
if has_server:
|
107
99
|
print("Running in server only mode.")
|
108
100
|
return run_server(args)
|
109
101
|
else:
|
@@ -114,8 +106,8 @@ def main() -> int:
|
|
114
106
|
if __name__ == "__main__":
|
115
107
|
# Note that the entry point for the exe is in cli.py
|
116
108
|
try:
|
117
|
-
sys.argv.append("-
|
118
|
-
sys.argv.append("examples/wasm")
|
109
|
+
sys.argv.append("-i")
|
110
|
+
# sys.argv.append("examples/wasm")
|
119
111
|
# sys.argv.append()
|
120
112
|
import os
|
121
113
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import argparse
|
2
1
|
import shutil
|
3
2
|
import tempfile
|
4
3
|
import threading
|
@@ -11,6 +10,7 @@ from fastled.docker_manager import DockerManager
|
|
11
10
|
from fastled.filewatcher import FileWatcherProcess
|
12
11
|
from fastled.keyboard import SpaceBarWatcher
|
13
12
|
from fastled.open_browser import open_browser_process
|
13
|
+
from fastled.parse_args import Args
|
14
14
|
from fastled.settings import DEFAULT_URL
|
15
15
|
from fastled.sketch import looks_like_sketch_directory
|
16
16
|
from fastled.types import BuildMode, CompileResult, CompileServerError
|
@@ -334,12 +334,12 @@ def run_client(
|
|
334
334
|
browser_proc.kill()
|
335
335
|
|
336
336
|
|
337
|
-
def run_client_server(args:
|
337
|
+
def run_client_server(args: Args) -> int:
|
338
338
|
profile = bool(args.profile)
|
339
339
|
web: str | bool = args.web if isinstance(args.web, str) else bool(args.web)
|
340
340
|
auto_update = bool(args.auto_update)
|
341
341
|
localhost = bool(args.localhost)
|
342
|
-
directory = Path(
|
342
|
+
directory = args.directory if args.directory else Path(".")
|
343
343
|
just_compile = bool(args.just_compile)
|
344
344
|
interactive = bool(args.interactive)
|
345
345
|
force_compile = bool(args.force_compile)
|
@@ -12,9 +12,20 @@ from fastled.sketch import (
|
|
12
12
|
looks_like_fastled_repo,
|
13
13
|
looks_like_sketch_directory,
|
14
14
|
)
|
15
|
+
from fastled.types import Args
|
15
16
|
|
16
17
|
|
17
|
-
def
|
18
|
+
def _find_fastled_repo(start: Path) -> Path | None:
|
19
|
+
"""Find the FastLED repo directory by searching upwards from the current directory."""
|
20
|
+
current = start
|
21
|
+
while current != current.parent:
|
22
|
+
if looks_like_fastled_repo(current):
|
23
|
+
return current
|
24
|
+
current = current.parent
|
25
|
+
return None
|
26
|
+
|
27
|
+
|
28
|
+
def parse_args() -> Args:
|
18
29
|
"""Parse command-line arguments."""
|
19
30
|
parser = argparse.ArgumentParser(description=f"FastLED WASM Compiler {__version__}")
|
20
31
|
parser.add_argument("--version", action="version", version=f"{__version__}")
|
@@ -131,8 +142,20 @@ def parse_args() -> argparse.Namespace:
|
|
131
142
|
print(f"Use 'fastled {args.directory}' to compile the project.")
|
132
143
|
sys.exit(0)
|
133
144
|
|
134
|
-
if args.build:
|
135
|
-
|
145
|
+
if args.build or args.interactive:
|
146
|
+
cwd: Path = Path(os.getcwd())
|
147
|
+
fastled_dir: Path | None = _find_fastled_repo(cwd)
|
148
|
+
if args.directory is not None:
|
149
|
+
args.directory = str(Path(args.directory).absolute())
|
150
|
+
if fastled_dir is None:
|
151
|
+
print("This command must be run from within the FastLED repo. Exiting...")
|
152
|
+
sys.exit(1)
|
153
|
+
if cwd != fastled_dir:
|
154
|
+
print(f"Switching to FastLED repo at {fastled_dir}")
|
155
|
+
os.chdir(fastled_dir)
|
156
|
+
if args.directory is None:
|
157
|
+
args.directory = str(Path("examples/wasm").absolute())
|
158
|
+
return Args.from_namespace(args)
|
136
159
|
|
137
160
|
if not args.update:
|
138
161
|
if args.no_auto_updates:
|
@@ -195,4 +218,4 @@ def parse_args() -> argparse.Namespace:
|
|
195
218
|
print(f"Using sketch directory: {dir_path}")
|
196
219
|
args.directory = str(dir_path)
|
197
220
|
|
198
|
-
return args
|
221
|
+
return Args.from_namespace(args)
|
@@ -72,7 +72,10 @@ def _lots_and_lots_of_files(directory: Path) -> bool:
|
|
72
72
|
return len(get_sketch_files(directory)) > 100
|
73
73
|
|
74
74
|
|
75
|
-
def looks_like_sketch_directory(directory: Path, quick=False) -> bool:
|
75
|
+
def looks_like_sketch_directory(directory: Path | str | None, quick=False) -> bool:
|
76
|
+
if directory is None:
|
77
|
+
return False
|
78
|
+
directory = Path(directory)
|
76
79
|
if looks_like_fastled_repo(directory):
|
77
80
|
print("Directory looks like the FastLED repo")
|
78
81
|
return False
|
@@ -0,0 +1,146 @@
|
|
1
|
+
import argparse
|
2
|
+
from dataclasses import dataclass
|
3
|
+
from enum import Enum
|
4
|
+
from pathlib import Path
|
5
|
+
from typing import Any
|
6
|
+
|
7
|
+
|
8
|
+
@dataclass
|
9
|
+
class Args:
|
10
|
+
directory: Path | None
|
11
|
+
init: bool | str
|
12
|
+
just_compile: bool
|
13
|
+
web: str | None
|
14
|
+
interactive: bool
|
15
|
+
profile: bool
|
16
|
+
force_compile: bool
|
17
|
+
auto_update: bool | None
|
18
|
+
update: bool
|
19
|
+
localhost: bool
|
20
|
+
build: bool
|
21
|
+
server: bool
|
22
|
+
purge: bool
|
23
|
+
debug: bool
|
24
|
+
quick: bool
|
25
|
+
release: bool
|
26
|
+
|
27
|
+
@staticmethod
|
28
|
+
def from_namespace(args: argparse.Namespace) -> "Args":
|
29
|
+
assert isinstance(
|
30
|
+
args.directory, str | None
|
31
|
+
), f"expected str | None, got {type(args.directory)}"
|
32
|
+
assert isinstance(
|
33
|
+
args.init, bool | str | None
|
34
|
+
), f"expected bool, got {type(args.init)}"
|
35
|
+
assert isinstance(
|
36
|
+
args.just_compile, bool
|
37
|
+
), f"expected bool, got {type(args.just_compile)}"
|
38
|
+
assert isinstance(
|
39
|
+
args.web, str | None
|
40
|
+
), f"expected str | None, got {type(args.web)}"
|
41
|
+
assert isinstance(
|
42
|
+
args.interactive, bool
|
43
|
+
), f"expected bool, got {type(args.interactive)}"
|
44
|
+
assert isinstance(
|
45
|
+
args.profile, bool
|
46
|
+
), f"expected bool, got {type(args.profile)}"
|
47
|
+
assert isinstance(
|
48
|
+
args.force_compile, bool
|
49
|
+
), f"expected bool, got {type(args.force_compile)}"
|
50
|
+
assert isinstance(
|
51
|
+
args.no_auto_updates, bool | None
|
52
|
+
), f"expected bool | None, got {type(args.no_auto_updates)}"
|
53
|
+
assert isinstance(args.update, bool), f"expected bool, got {type(args.update)}"
|
54
|
+
assert isinstance(
|
55
|
+
args.localhost, bool
|
56
|
+
), f"expected bool, got {type(args.localhost)}"
|
57
|
+
assert isinstance(args.build, bool), f"expected bool, got {type(args.build)}"
|
58
|
+
assert isinstance(args.server, bool), f"expected bool, got {type(args.server)}"
|
59
|
+
assert isinstance(args.purge, bool), f"expected bool, got {type(args.purge)}"
|
60
|
+
assert isinstance(args.debug, bool), f"expected bool, got {type(args.debug)}"
|
61
|
+
assert isinstance(args.quick, bool), f"expected bool, got {type(args.quick)}"
|
62
|
+
assert isinstance(
|
63
|
+
args.release, bool
|
64
|
+
), f"expected bool, got {type(args.release)}"
|
65
|
+
init: bool | str = False
|
66
|
+
if args.init is None:
|
67
|
+
init = False
|
68
|
+
elif isinstance(args.init, bool):
|
69
|
+
init = args.init
|
70
|
+
elif isinstance(args.init, str):
|
71
|
+
init = args.init
|
72
|
+
return Args(
|
73
|
+
directory=Path(args.directory) if args.directory else None,
|
74
|
+
init=init,
|
75
|
+
just_compile=args.just_compile,
|
76
|
+
web=args.web,
|
77
|
+
interactive=args.interactive,
|
78
|
+
profile=args.profile,
|
79
|
+
force_compile=args.force_compile,
|
80
|
+
auto_update=not args.no_auto_updates,
|
81
|
+
update=args.update,
|
82
|
+
localhost=args.localhost,
|
83
|
+
build=args.build,
|
84
|
+
server=args.server,
|
85
|
+
purge=args.purge,
|
86
|
+
debug=args.debug,
|
87
|
+
quick=args.quick,
|
88
|
+
release=args.release,
|
89
|
+
)
|
90
|
+
|
91
|
+
|
92
|
+
@dataclass
|
93
|
+
class CompileResult:
|
94
|
+
success: bool
|
95
|
+
stdout: str
|
96
|
+
hash_value: str | None
|
97
|
+
zip_bytes: bytes
|
98
|
+
|
99
|
+
def __bool__(self) -> bool:
|
100
|
+
return self.success
|
101
|
+
|
102
|
+
def to_dict(self) -> dict[str, Any]:
|
103
|
+
return self.__dict__.copy()
|
104
|
+
|
105
|
+
|
106
|
+
class CompileServerError(Exception):
|
107
|
+
"""Error class for failing to instantiate CompileServer."""
|
108
|
+
|
109
|
+
pass
|
110
|
+
|
111
|
+
|
112
|
+
class BuildMode(Enum):
|
113
|
+
DEBUG = "DEBUG"
|
114
|
+
QUICK = "QUICK"
|
115
|
+
RELEASE = "RELEASE"
|
116
|
+
|
117
|
+
@classmethod
|
118
|
+
def from_string(cls, mode_str: str) -> "BuildMode":
|
119
|
+
try:
|
120
|
+
return cls[mode_str.upper()]
|
121
|
+
except KeyError:
|
122
|
+
valid_modes = [mode.name for mode in cls]
|
123
|
+
raise ValueError(f"BUILD_MODE must be one of {valid_modes}, got {mode_str}")
|
124
|
+
|
125
|
+
@staticmethod
|
126
|
+
def from_args(args: Args) -> "BuildMode":
|
127
|
+
if args.debug:
|
128
|
+
return BuildMode.DEBUG
|
129
|
+
elif args.release:
|
130
|
+
return BuildMode.RELEASE
|
131
|
+
else:
|
132
|
+
return BuildMode.QUICK
|
133
|
+
|
134
|
+
|
135
|
+
class Platform(Enum):
|
136
|
+
WASM = "WASM"
|
137
|
+
|
138
|
+
@classmethod
|
139
|
+
def from_string(cls, platform_str: str) -> "Platform":
|
140
|
+
try:
|
141
|
+
return cls[platform_str.upper()]
|
142
|
+
except KeyError:
|
143
|
+
valid_modes = [mode.name for mode in cls]
|
144
|
+
raise ValueError(
|
145
|
+
f"Platform must be one of {valid_modes}, got {platform_str}"
|
146
|
+
)
|
@@ -1,61 +0,0 @@
|
|
1
|
-
import argparse
|
2
|
-
from dataclasses import dataclass
|
3
|
-
from enum import Enum
|
4
|
-
from typing import Any
|
5
|
-
|
6
|
-
|
7
|
-
@dataclass
|
8
|
-
class CompileResult:
|
9
|
-
success: bool
|
10
|
-
stdout: str
|
11
|
-
hash_value: str | None
|
12
|
-
zip_bytes: bytes
|
13
|
-
|
14
|
-
def __bool__(self) -> bool:
|
15
|
-
return self.success
|
16
|
-
|
17
|
-
def to_dict(self) -> dict[str, Any]:
|
18
|
-
return self.__dict__.copy()
|
19
|
-
|
20
|
-
|
21
|
-
class CompileServerError(Exception):
|
22
|
-
"""Error class for failing to instantiate CompileServer."""
|
23
|
-
|
24
|
-
pass
|
25
|
-
|
26
|
-
|
27
|
-
class BuildMode(Enum):
|
28
|
-
DEBUG = "DEBUG"
|
29
|
-
QUICK = "QUICK"
|
30
|
-
RELEASE = "RELEASE"
|
31
|
-
|
32
|
-
@classmethod
|
33
|
-
def from_string(cls, mode_str: str) -> "BuildMode":
|
34
|
-
try:
|
35
|
-
return cls[mode_str.upper()]
|
36
|
-
except KeyError:
|
37
|
-
valid_modes = [mode.name for mode in cls]
|
38
|
-
raise ValueError(f"BUILD_MODE must be one of {valid_modes}, got {mode_str}")
|
39
|
-
|
40
|
-
@staticmethod
|
41
|
-
def from_args(args: argparse.Namespace) -> "BuildMode":
|
42
|
-
if args.debug:
|
43
|
-
return BuildMode.DEBUG
|
44
|
-
elif args.release:
|
45
|
-
return BuildMode.RELEASE
|
46
|
-
else:
|
47
|
-
return BuildMode.QUICK
|
48
|
-
|
49
|
-
|
50
|
-
class Platform(Enum):
|
51
|
-
WASM = "WASM"
|
52
|
-
|
53
|
-
@classmethod
|
54
|
-
def from_string(cls, platform_str: str) -> "Platform":
|
55
|
-
try:
|
56
|
-
return cls[platform_str.upper()]
|
57
|
-
except KeyError:
|
58
|
-
valid_modes = [mode.name for mode in cls]
|
59
|
-
raise ValueError(
|
60
|
-
f"Platform must be one of {valid_modes}, got {platform_str}"
|
61
|
-
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|