fastled 1.2.35__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.
Files changed (89) hide show
  1. {fastled-1.2.35 → fastled-1.2.36}/PKG-INFO +1 -2
  2. {fastled-1.2.35 → fastled-1.2.36}/README.md +0 -1
  3. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/__init__.py +1 -1
  4. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/app.py +6 -14
  5. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/client_server.py +3 -3
  6. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/parse_args.py +11 -7
  7. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/sketch.py +4 -1
  8. fastled-1.2.36/src/fastled/types.py +146 -0
  9. {fastled-1.2.35 → fastled-1.2.36}/src/fastled.egg-info/PKG-INFO +1 -2
  10. fastled-1.2.35/src/fastled/types.py +0 -61
  11. {fastled-1.2.35 → fastled-1.2.36}/.aiderignore +0 -0
  12. {fastled-1.2.35 → fastled-1.2.36}/.github/workflows/build_multi_docker_image.yml +0 -0
  13. {fastled-1.2.35 → fastled-1.2.36}/.github/workflows/build_webpage.yml +0 -0
  14. {fastled-1.2.35 → fastled-1.2.36}/.github/workflows/lint.yml +0 -0
  15. {fastled-1.2.35 → fastled-1.2.36}/.github/workflows/publish_release.yml +0 -0
  16. {fastled-1.2.35 → fastled-1.2.36}/.github/workflows/test_build_exe.yml +0 -0
  17. {fastled-1.2.35 → fastled-1.2.36}/.github/workflows/test_macos.yml +0 -0
  18. {fastled-1.2.35 → fastled-1.2.36}/.github/workflows/test_ubuntu.yml +0 -0
  19. {fastled-1.2.35 → fastled-1.2.36}/.github/workflows/test_win.yml +0 -0
  20. {fastled-1.2.35 → fastled-1.2.36}/.gitignore +0 -0
  21. {fastled-1.2.35 → fastled-1.2.36}/.pylintrc +0 -0
  22. {fastled-1.2.35 → fastled-1.2.36}/.vscode/launch.json +0 -0
  23. {fastled-1.2.35 → fastled-1.2.36}/.vscode/settings.json +0 -0
  24. {fastled-1.2.35 → fastled-1.2.36}/.vscode/tasks.json +0 -0
  25. {fastled-1.2.35 → fastled-1.2.36}/LICENSE +0 -0
  26. {fastled-1.2.35 → fastled-1.2.36}/MANIFEST.in +0 -0
  27. {fastled-1.2.35 → fastled-1.2.36}/RELEASE.md +0 -0
  28. {fastled-1.2.35 → fastled-1.2.36}/TODO.md +0 -0
  29. {fastled-1.2.35 → fastled-1.2.36}/build_exe.py +0 -0
  30. {fastled-1.2.35 → fastled-1.2.36}/build_site.py +0 -0
  31. {fastled-1.2.35 → fastled-1.2.36}/clean +0 -0
  32. {fastled-1.2.35 → fastled-1.2.36}/install +0 -0
  33. {fastled-1.2.35 → fastled-1.2.36}/install_linux.sh +0 -0
  34. {fastled-1.2.35 → fastled-1.2.36}/lint +0 -0
  35. {fastled-1.2.35 → fastled-1.2.36}/pyproject.toml +0 -0
  36. {fastled-1.2.35 → fastled-1.2.36}/requirements.testing.txt +0 -0
  37. {fastled-1.2.35 → fastled-1.2.36}/setup.cfg +0 -0
  38. {fastled-1.2.35 → fastled-1.2.36}/setup.py +0 -0
  39. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/assets/example.txt +0 -0
  40. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/cli.py +0 -0
  41. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/compile_server.py +0 -0
  42. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/compile_server_impl.py +0 -0
  43. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/docker_manager.py +0 -0
  44. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/filewatcher.py +0 -0
  45. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/keyboard.py +0 -0
  46. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/live_client.py +0 -0
  47. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/open_browser.py +0 -0
  48. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/open_browser2.py +0 -0
  49. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/paths.py +0 -0
  50. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/project_init.py +0 -0
  51. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/select_sketch_directory.py +0 -0
  52. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/settings.py +0 -0
  53. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/site/build.py +0 -0
  54. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/spinner.py +0 -0
  55. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/string_diff.py +0 -0
  56. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/test/can_run_local_docker_tests.py +0 -0
  57. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/test/examples.py +0 -0
  58. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/util.py +0 -0
  59. {fastled-1.2.35 → fastled-1.2.36}/src/fastled/web_compile.py +0 -0
  60. {fastled-1.2.35 → fastled-1.2.36}/src/fastled.egg-info/SOURCES.txt +0 -0
  61. {fastled-1.2.35 → fastled-1.2.36}/src/fastled.egg-info/dependency_links.txt +0 -0
  62. {fastled-1.2.35 → fastled-1.2.36}/src/fastled.egg-info/entry_points.txt +0 -0
  63. {fastled-1.2.35 → fastled-1.2.36}/src/fastled.egg-info/requires.txt +0 -0
  64. {fastled-1.2.35 → fastled-1.2.36}/src/fastled.egg-info/top_level.txt +0 -0
  65. {fastled-1.2.35 → fastled-1.2.36}/test +0 -0
  66. {fastled-1.2.35 → fastled-1.2.36}/tests/html/index.html +0 -0
  67. {fastled-1.2.35 → fastled-1.2.36}/tests/test_api.py +0 -0
  68. {fastled-1.2.35 → fastled-1.2.36}/tests/test_bad_ino.py +0 -0
  69. {fastled-1.2.35 → fastled-1.2.36}/tests/test_build.py +0 -0
  70. {fastled-1.2.35 → fastled-1.2.36}/tests/test_build_examples.py +0 -0
  71. {fastled-1.2.35 → fastled-1.2.36}/tests/test_build_from_docker.py +0 -0
  72. {fastled-1.2.35 → fastled-1.2.36}/tests/test_build_from_github.py +0 -0
  73. {fastled-1.2.35 → fastled-1.2.36}/tests/test_cli.py +0 -0
  74. {fastled-1.2.35 → fastled-1.2.36}/tests/test_compile_server.py +0 -0
  75. {fastled-1.2.35 → fastled-1.2.36}/tests/test_docker_linux_on_windows.py +0 -0
  76. {fastled-1.2.35 → fastled-1.2.36}/tests/test_embedded_data.py +0 -0
  77. {fastled-1.2.35 → fastled-1.2.36}/tests/test_examples.py +0 -0
  78. {fastled-1.2.35 → fastled-1.2.36}/tests/test_filechanger.py +0 -0
  79. {fastled-1.2.35 → fastled-1.2.36}/tests/test_http_server.py +0 -0
  80. {fastled-1.2.35 → fastled-1.2.36}/tests/test_ino/bad/bad.ino +0 -0
  81. {fastled-1.2.35 → fastled-1.2.36}/tests/test_ino/bad_platformio/bad_platformio.ino +0 -0
  82. {fastled-1.2.35 → fastled-1.2.36}/tests/test_ino/bad_platformio/platformio.ini +0 -0
  83. {fastled-1.2.35 → fastled-1.2.36}/tests/test_ino/embedded/data/bigdata.dat +0 -0
  84. {fastled-1.2.35 → fastled-1.2.36}/tests/test_ino/embedded/wasm.ino +0 -0
  85. {fastled-1.2.35 → fastled-1.2.36}/tests/test_ino/wasm/wasm.ino +0 -0
  86. {fastled-1.2.35 → fastled-1.2.36}/tests/test_project_init.py +0 -0
  87. {fastled-1.2.35 → fastled-1.2.36}/tests/test_server_and_client_seperatly.py +0 -0
  88. {fastled-1.2.35 → fastled-1.2.36}/tests/test_webcompile.py +0 -0
  89. {fastled-1.2.35 → fastled-1.2.36}/upload_package.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: fastled
3
- Version: 1.2.35
3
+ Version: 1.2.36
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -293,7 +293,6 @@ A: `delay()` will block `loop()` which blocks the main thread of the browser. Th
293
293
  Q: How can I get the compiled size of my FastLED sketch smaller?
294
294
  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.
295
295
 
296
-
297
296
  # Revisions
298
297
 
299
298
  * 1.2.31 - Bunch of fixes and ease of use while compiling code in the repo.
@@ -267,7 +267,6 @@ A: `delay()` will block `loop()` which blocks the main thread of the browser. Th
267
267
  Q: How can I get the compiled size of my FastLED sketch smaller?
268
268
  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.
269
269
 
270
-
271
270
  # Revisions
272
271
 
273
272
  * 1.2.31 - Bunch of fixes and ease of use while compiling code in the repo.
@@ -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.35"
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: argparse.Namespace) -> int:
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
- server: str | CompileServer | None = args.server
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 server:
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("-b")
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: argparse.Namespace) -> int:
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(args.directory)
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,8 +12,10 @@ 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
- def _find_fastled_repo(start: Path) -> Path:
17
+
18
+ def _find_fastled_repo(start: Path) -> Path | None:
17
19
  """Find the FastLED repo directory by searching upwards from the current directory."""
18
20
  current = start
19
21
  while current != current.parent:
@@ -23,7 +25,7 @@ def _find_fastled_repo(start: Path) -> Path:
23
25
  return None
24
26
 
25
27
 
26
- def parse_args() -> argparse.Namespace:
28
+ def parse_args() -> Args:
27
29
  """Parse command-line arguments."""
28
30
  parser = argparse.ArgumentParser(description=f"FastLED WASM Compiler {__version__}")
29
31
  parser.add_argument("--version", action="version", version=f"{__version__}")
@@ -143,15 +145,17 @@ def parse_args() -> argparse.Namespace:
143
145
  if args.build or args.interactive:
144
146
  cwd: Path = Path(os.getcwd())
145
147
  fastled_dir: Path | None = _find_fastled_repo(cwd)
148
+ if args.directory is not None:
149
+ args.directory = str(Path(args.directory).absolute())
146
150
  if fastled_dir is None:
147
- print(
148
- "This command must be run from within the FastLED repo. Exiting..."
149
- )
151
+ print("This command must be run from within the FastLED repo. Exiting...")
150
152
  sys.exit(1)
151
153
  if cwd != fastled_dir:
152
154
  print(f"Switching to FastLED repo at {fastled_dir}")
153
155
  os.chdir(fastled_dir)
154
- return args
156
+ if args.directory is None:
157
+ args.directory = str(Path("examples/wasm").absolute())
158
+ return Args.from_namespace(args)
155
159
 
156
160
  if not args.update:
157
161
  if args.no_auto_updates:
@@ -214,4 +218,4 @@ def parse_args() -> argparse.Namespace:
214
218
  print(f"Using sketch directory: {dir_path}")
215
219
  args.directory = str(dir_path)
216
220
 
217
- 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,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: fastled
3
- Version: 1.2.35
3
+ Version: 1.2.36
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -293,7 +293,6 @@ A: `delay()` will block `loop()` which blocks the main thread of the browser. Th
293
293
  Q: How can I get the compiled size of my FastLED sketch smaller?
294
294
  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.
295
295
 
296
-
297
296
  # Revisions
298
297
 
299
298
  * 1.2.31 - Bunch of fixes and ease of use while compiling code in the repo.
@@ -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