fastled 1.3.10__py3-none-any.whl → 1.3.11__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/__version__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  # IMPORTANT! There's a bug in github which will REJECT any version update
2
2
  # that has any other change in the repo. Please bump the version as the
3
3
  # ONLY change in a commit, or else the pypi update and the release will fail.
4
- __version__ = "1.3.10"
4
+ __version__ = "1.3.11"
5
5
 
6
6
  __version_url_latest__ = "https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/src/fastled/__version__.py"
fastled/app.py CHANGED
@@ -2,6 +2,7 @@
2
2
  Uses the latest wasm compiler image to compile the FastLED sketch.
3
3
  """
4
4
 
5
+ import os
5
6
  import sys
6
7
  import time
7
8
  from pathlib import Path
fastled/args.py CHANGED
@@ -62,6 +62,7 @@ class Args:
62
62
  assert isinstance(
63
63
  args.release, bool
64
64
  ), f"expected bool, got {type(args.release)}"
65
+
65
66
  init: bool | str = False
66
67
  if args.init is None:
67
68
  init = False
fastled/cli.py CHANGED
@@ -3,7 +3,6 @@ Main entry point.
3
3
  """
4
4
 
5
5
  import multiprocessing
6
- import os
7
6
  import sys
8
7
 
9
8
 
@@ -16,9 +15,9 @@ def run_app() -> int:
16
15
 
17
16
  def main() -> int:
18
17
  """Main entry point for the template_python_cmd package."""
19
- if "--debug" in sys.argv:
20
- # Debug mode
21
- os.environ["FLASK_SERVER_LOGGING"] = "1"
18
+ # if "--debug" in sys.argv:
19
+ # # Debug mode
20
+ # os.environ["FLASK_SERVER_LOGGING"] = "1"
22
21
  return run_app()
23
22
 
24
23
 
fastled/docker_manager.py CHANGED
@@ -36,7 +36,7 @@ _IS_GITHUB = "GITHUB_ACTIONS" in os.environ
36
36
  _DEFAULT_BUILD_DIR = "/js/.pio/build"
37
37
 
38
38
 
39
- os.environ.get("FASTLED_FORCE_CLEAR", "0") == "1"
39
+ FORCE_CLEAR: bool = bool(os.environ.get("FASTLED_FORCE_CLEAR", "0") == "1")
40
40
 
41
41
 
42
42
  # Docker uses datetimes in UTC but without the timezone info. If we pass in a tz
@@ -68,6 +68,11 @@ def get_ramdisk_size() -> str | None:
68
68
  return None # Defaults to off
69
69
 
70
70
 
71
+ def get_force_remove_image_previous() -> bool:
72
+ """Get the force remove image previous value."""
73
+ return os.environ.get("FASTLED_FORCE_CLEAR", "0") == "1"
74
+
75
+
71
76
  def set_clear() -> None:
72
77
  os.environ["FASTLED_FORCE_CLEAR"] = "1"
73
78
 
@@ -218,6 +223,18 @@ def _hack_to_fix_mac(volumes: list[Volume] | None) -> list[Volume] | None:
218
223
  return volumes
219
224
 
220
225
 
226
+ def set_force_remove_image_previous(new_value: str | None = None) -> None:
227
+ if new_value is not None:
228
+ os.environ["FASTLED_FORCE_CLEAR"] = new_value
229
+ else:
230
+ os.environ["FASTLED_FORCE_CLEAR"] == "1"
231
+
232
+
233
+ def force_image_removal() -> bool:
234
+ """Get the force remove image previous value."""
235
+ return os.environ.get("FASTLED_FORCE_CLEAR", "0") == "1"
236
+
237
+
221
238
  class DockerManager:
222
239
  def __init__(self) -> None:
223
240
  from docker.errors import DockerException
@@ -635,6 +652,13 @@ class DockerManager:
635
652
  ports: Dict mapping host ports to container ports
636
653
  Example: {8080: 80} maps host port 8080 to container port 80
637
654
  """
655
+ remove_previous = remove_previous or get_force_remove_image_previous()
656
+ if remove_previous:
657
+ # make a banner print
658
+ print(
659
+ "Force removing previous image due to FASTLED_FORCE_CLEAR environment variable."
660
+ )
661
+
638
662
  tmpfs_size = tmpfs_size or get_ramdisk_size()
639
663
  sys_admin = tmpfs_size is not None and tmpfs_size != "0"
640
664
  volumes = _hack_to_fix_mac(volumes)
fastled/parse_args.py CHANGED
@@ -146,6 +146,12 @@ def parse_args() -> Args:
146
146
  help="Remove all FastLED containers and images",
147
147
  )
148
148
 
149
+ parser.add_argument(
150
+ "--clear",
151
+ action="store_true",
152
+ help="Remove all FastLED containers and images",
153
+ )
154
+
149
155
  build_mode = parser.add_mutually_exclusive_group()
150
156
  build_mode.add_argument("--debug", action="store_true", help="Build in debug mode")
151
157
  build_mode.add_argument(
@@ -162,13 +168,24 @@ def parse_args() -> Args:
162
168
 
163
169
  args = parser.parse_args()
164
170
 
165
- if args.ram_disk_size != "0":
166
- from fastled.docker_manager import set_ramdisk_size
167
- from fastled.util import banner_string
171
+ # TODO: propagate the library.
172
+ # from fastled.docker_manager import force_remove_previous
168
173
 
169
- msg = banner_string(f"Setting tmpfs size to {args.ram_disk_size}")
170
- print(msg)
171
- set_ramdisk_size(args.ram_disk_size)
174
+ # if force_remove_previous():
175
+ # print("Removing previous containers...")
176
+ # do itinfront he camer
177
+ # nonw invoke via the
178
+ #
179
+ # Work in progress.
180
+ # set_ramdisk_size("50mb")
181
+
182
+ # if args.ram_disk_size != "0":
183
+ # from fastled.docker_manager import set_ramdisk_size
184
+ # from fastled.util import banner_string
185
+
186
+ # msg = banner_string(f"Setting tmpfs size to {args.ram_disk_size}")
187
+ # print(msg)
188
+ # set_ramdisk_size(args.ram_disk_size)
172
189
 
173
190
  if args.purge:
174
191
  from fastled.docker_manager import DockerManager
@@ -188,15 +205,23 @@ def parse_args() -> Args:
188
205
  print(f"Use 'fastled {args.directory}' to compile the project.")
189
206
  sys.exit(0)
190
207
 
208
+ cwd: Path = Path(os.getcwd())
209
+ fastled_dir: Path | None = _find_fastled_repo(cwd)
210
+ is_fastled_dir: bool = fastled_dir is not None
211
+
212
+ if is_fastled_dir:
213
+ # if --quick, --debug, --release are not specified then default to --debug
214
+ if not (args.debug or args.quick or args.release):
215
+ args.debug = True
216
+ print("Defaulting to --debug mode")
217
+
191
218
  if args.build or args.interactive:
192
- cwd: Path = Path(os.getcwd())
193
- fastled_dir: Path | None = _find_fastled_repo(cwd)
194
219
  if args.directory is not None:
195
220
  args.directory = str(Path(args.directory).absolute())
196
- if fastled_dir is None:
221
+ if not is_fastled_dir:
197
222
  print("This command must be run from within the FastLED repo. Exiting...")
198
223
  sys.exit(1)
199
- if cwd != fastled_dir:
224
+ if cwd != fastled_dir and fastled_dir is not None:
200
225
  print(f"Switching to FastLED repo at {fastled_dir}")
201
226
  os.chdir(fastled_dir)
202
227
  if args.directory is None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastled
3
- Version: 1.3.10
3
+ Version: 1.3.11
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -1,20 +1,20 @@
1
1
  fastled/__init__.py,sha256=YLikXGRWKlKAqj7bpvGmJLejGTFF-FC1lv2z1jwRinA,6852
2
- fastled/__version__.py,sha256=7QpiB0fkCVDeQpQ85nRmXbvX0zrIl80FW316eQ25yMc,373
3
- fastled/app.py,sha256=UObQfgAcFSLXr_N04D4PSI15_p5CFz4bEj_MuBMHyKE,5859
4
- fastled/args.py,sha256=chqZa6mRbqWBEvfs8vbw3Z3SQczk22_JcvDwv2vGZdY,3280
5
- fastled/cli.py,sha256=5EBsb02ueFUjlgrlg0GMdj3e5nnHVhvofmYyQRaw8uM,565
2
+ fastled/__version__.py,sha256=KmmoedZhGt1dbJf1JiJmTN7nqvZDgK3S5V6UR0CU8hM,373
3
+ fastled/app.py,sha256=I8Kxbm6vpN5WxHIhesoSkZtNNho5aHqUDGTaesu8hcM,5869
4
+ fastled/args.py,sha256=d9CaarQ1yw7w0REwgrNQ78zOUQSk94fTXwXHtFZPTSY,3281
5
+ fastled/cli.py,sha256=drgR2AOxVrj3QEz58iiKscYAumbbin2vIV-k91VCOAA,561
6
6
  fastled/cli_test.py,sha256=qJB9yLRFR3OwOwdIWSQ0fQsWLnA37v5pDccufiP_hTs,512
7
7
  fastled/cli_test_interactive.py,sha256=BjNhveZOk5aCffHbcrxPQQjWmAuj4ClVKKcKX5eY6yM,542
8
8
  fastled/client_server.py,sha256=uK-reqTN4umtVm8K3fcLo2Op_P_jFKVFtKFJRpBF1Xs,18598
9
9
  fastled/compile_server.py,sha256=rkXvrvdav5vDG8lv_OlBX3YSCHtnHMt25nXbfeg_r78,2960
10
10
  fastled/compile_server_impl.py,sha256=MIe-GvKenoDaqX8VhCJ7KNIWTOHHcLPgUQ7kO6lsa38,12199
11
- fastled/docker_manager.py,sha256=aF4_XH_1FF7pW0CB1DKOwyVEf2PbejBmzDXOzthEnL8,39383
11
+ fastled/docker_manager.py,sha256=18m6lc54leN5Pjj9wropP-CJ5KAa25WIS5_koFZB7Ng,40215
12
12
  fastled/filewatcher.py,sha256=3qS3L7zMQhFuVrkeGn1djsB_cB6x_E2YGJmmQWVAU_w,10033
13
13
  fastled/keyboard.py,sha256=UTAsqCn1UMYnB8YDzENiLTj4GeL45tYfEcO7_5fLFEg,3556
14
14
  fastled/keyz.py,sha256=LO-8m_7CpNDiZLM-FXhQ30f9gN1bUYz5lOsUPTIbI-c,4020
15
15
  fastled/live_client.py,sha256=yoAul8tVgbbPf1oEC79SUZSHkLECxlrXxgWR9XaBIp4,2957
16
16
  fastled/open_browser.py,sha256=DFyMrc1qic4Go7eLNPqMaLuMvTaE73NixdfSKV0yyp8,3709
17
- fastled/parse_args.py,sha256=EnJa0FZi8RPtIzldK-CJRJvQhl83rCzz-oQrIDok2e8,9937
17
+ fastled/parse_args.py,sha256=z2UO5DxTr7wnsT6-QTF26lrBM60_kTz7t-bxbcP4bm0,10701
18
18
  fastled/paths.py,sha256=VsPmgu0lNSCFOoEC0BsTYzDygXqy15AHUfN-tTuzDZA,99
19
19
  fastled/print_filter.py,sha256=oomBjrouWNPCgJY2guCpljTijFvNKRBVbipDrxIsszA,7426
20
20
  fastled/project_init.py,sha256=bBt4DwmW5hZkm9ICt9Qk-0Nr_0JQM7icCgH5Iv-bCQs,3984
@@ -36,9 +36,9 @@ fastled/site/build.py,sha256=2YKU_UWKlJdGnjdbAbaL0co6kceFMSTVYwH1KCmgPZA,13987
36
36
  fastled/site/examples.py,sha256=s6vj2zJc6BfKlnbwXr1QWY1mzuDBMt6j5MEBOWjO_U8,155
37
37
  fastled/test/can_run_local_docker_tests.py,sha256=LEuUbHctRhNNFWcvnz2kEGmjDJeXO4c3kNpizm3yVJs,400
38
38
  fastled/test/examples.py,sha256=GfaHeY1E8izBl6ZqDVjz--RHLyVR4NRnQ5pBesCFJFY,1673
39
- fastled-1.3.10.dist-info/licenses/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
40
- fastled-1.3.10.dist-info/METADATA,sha256=EXXCG6ZWbD_tSmhsyDNMWx8_MXI20qZPaO9o09mWCKc,30050
41
- fastled-1.3.10.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
42
- fastled-1.3.10.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
43
- fastled-1.3.10.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
44
- fastled-1.3.10.dist-info/RECORD,,
39
+ fastled-1.3.11.dist-info/licenses/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
40
+ fastled-1.3.11.dist-info/METADATA,sha256=ZcoMV7PUI60nsg9Z4KnBeTwJcfA0hDvRhSGDtSy3_58,30050
41
+ fastled-1.3.11.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
42
+ fastled-1.3.11.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
43
+ fastled-1.3.11.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
44
+ fastled-1.3.11.dist-info/RECORD,,