fastled 1.2.99__py3-none-any.whl → 1.3.1__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
@@ -14,7 +14,7 @@ from .types import BuildMode, CompileResult, CompileServerError, FileResponse
14
14
  # IMPORTANT! There's a bug in github which will REJECT any version update
15
15
  # that has any other change in the repo. Please bump the version as the
16
16
  # ONLY change in a commit, or else the pypi update and the release will fail.
17
- __version__ = "1.2.99"
17
+ __version__ = "1.3.1"
18
18
 
19
19
 
20
20
  class Api:
fastled/app.py CHANGED
@@ -51,6 +51,7 @@ def run_server(args: Args) -> int:
51
51
 
52
52
  def main() -> int:
53
53
  from fastled import __version__
54
+ from fastled.select_sketch_directory import select_sketch_directory
54
55
 
55
56
  args = parse_args()
56
57
  interactive: bool = args.interactive
@@ -70,14 +71,11 @@ def main() -> int:
70
71
  # then prompt the user for a sketch directory.
71
72
  # 2. Tell the user they can use --server --interactive to
72
73
  # skip this prompt.
73
-
74
- from fastled.select_sketch_directory import select_sketch_directory
75
-
76
74
  if interactive and cwd_looks_like_fastled_repo and directory is None:
77
75
  answer = input(
78
76
  "No sketch directory selected, would you like to select one? (y/n): "
79
77
  )
80
- if answer.lower() == "y":
78
+ if answer.lower()[:1] == "y" or answer.lower() == "":
81
79
  sketch_list: list[Path] = find_sketch_directories()
82
80
  if sketch_list:
83
81
  maybe_dir: str | None = select_sketch_directory(
@@ -109,12 +107,6 @@ def main() -> int:
109
107
  # print(f"Building Docker image at {project_root}")
110
108
  from fastled import Api
111
109
 
112
- # server = Docker.spawn_server_from_fastled_repo(
113
- # project_root=project_root,
114
- # interactive=interactive,
115
- # sketch_folder=directory,
116
- # )
117
- # assert isinstance(server, CompileServer)
118
110
  server: CompileServer = CompileServer(
119
111
  interactive=interactive,
120
112
  auto_updates=False,
fastled/compile_server.py CHANGED
@@ -1,6 +1,6 @@
1
1
  from pathlib import Path
2
2
 
3
- from fastled.types import BuildMode, CompileResult, FileResponse, Platform
3
+ from fastled.types import BuildMode, CompileResult, Platform
4
4
 
5
5
 
6
6
  class CompileServer:
@@ -53,10 +53,6 @@ class CompileServer:
53
53
 
54
54
  project_init(example=example, outputdir=outputdir)
55
55
 
56
- def fetch_source_file(self, filepath: str) -> FileResponse | Exception:
57
- """Get the source file from the server."""
58
- return self.impl.fetch_source_file(filepath)
59
-
60
56
  @property
61
57
  def name(self) -> str:
62
58
  return self.impl.container_name
@@ -17,7 +17,7 @@ from fastled.docker_manager import (
17
17
  )
18
18
  from fastled.settings import DEFAULT_CONTAINER_NAME, IMAGE_NAME, SERVER_PORT
19
19
  from fastled.sketch import looks_like_fastled_repo
20
- from fastled.types import BuildMode, CompileResult, CompileServerError, FileResponse
20
+ from fastled.types import BuildMode, CompileResult, CompileServerError
21
21
  from fastled.util import port_is_free
22
22
 
23
23
  SERVER_OPTIONS = [
@@ -183,29 +183,6 @@ class CompileServerImpl:
183
183
  return False
184
184
  return False
185
185
 
186
- def fetch_source_file(self, filepath: str) -> FileResponse | Exception:
187
- """Get the source file from the server."""
188
- if not self._port:
189
- raise RuntimeError("Server has not been started yet")
190
- try:
191
- httpx_client = httpx.Client()
192
- url = f"http://localhost:{self._port}/sourcefiles/{filepath}"
193
- response = httpx_client.get(url, follow_redirects=True)
194
- if response.status_code == 200:
195
- content = response.text
196
- mimetype: str = response.headers.get("Content-Type", "text/plain")
197
- return FileResponse(
198
- content=content,
199
- mimetype=mimetype,
200
- filename=filepath,
201
- )
202
- else:
203
- return CompileServerError(
204
- f"Error fetching file {filepath}: {response.status_code}"
205
- )
206
- except httpx.RequestError as e:
207
- return CompileServerError(f"Error fetching file {filepath}: {e}")
208
-
209
186
  def _start(self) -> int:
210
187
  print("Compiling server starting")
211
188
 
fastled/server_flask.py CHANGED
@@ -125,9 +125,14 @@ def _run_flask_server(
125
125
  logger.error(f"Error forwarding request: {e}", exc_info=True)
126
126
  return Response(f"Error: {str(e)}", status=500)
127
127
 
128
- def handle_dwarfsource(path: str) -> Response:
129
- """Handle requests to /drawfsource/js/fastled/src/
130
- or /drawfsource/js/drawfsource/emsdk/*"""
128
+ def handle_fastledsource(path: str) -> Response:
129
+ """Handle requests to
130
+ /fastledsource/js/fastledsource/git/fastled/src/
131
+ or
132
+ /sketchsource/js/src/Blink.ino
133
+
134
+ The names are a bit mangled due to the way C++ prefixing works near the root directory.
135
+ """
131
136
  from flask import request
132
137
 
133
138
  start_time = time.time()
@@ -314,9 +319,11 @@ def _run_flask_server(
314
319
  logger.info(f"Received request for path: {path}")
315
320
 
316
321
  try:
317
- if path.startswith("drawfsource/"):
322
+ if path.startswith("fastledsource/") or path.startswith(
323
+ "sketchsource/"
324
+ ):
318
325
  logger.info(f"Handling as drawfsource: {path}")
319
- return handle_dwarfsource(path)
326
+ return handle_fastledsource(path)
320
327
  elif path.startswith("sourcefiles/"):
321
328
  logger.info(f"Handling as sourcefiles: {path}")
322
329
  return handle_sourcefile(path)
fastled/web_compile.py CHANGED
@@ -100,6 +100,9 @@ def zip_files(directory: Path, build_mode: BuildMode) -> ZipResult | Exception:
100
100
  zip_buffer, "w", zipfile.ZIP_DEFLATED, compresslevel=9
101
101
  ) as zip_file:
102
102
  for file_path in files:
103
+ if "fastled_js" in str(file_path):
104
+ # These can be huge, don't send the output files back to the server!
105
+ continue
103
106
  relative_path = file_path.relative_to(directory)
104
107
  achive_path = str(Path("wasm") / relative_path)
105
108
  if str(relative_path).startswith("data") and ENABLE_EMBEDDED_DATA:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastled
3
- Version: 1.2.99
3
+ Version: 1.3.1
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -20,7 +20,7 @@ Requires-Dist: progress>=1.6
20
20
  Requires-Dist: watchfiles>=1.0.5
21
21
  Requires-Dist: Flask>=3.0.0
22
22
  Requires-Dist: livereload
23
- Requires-Dist: fastled-wasm-server>=1.0.21
23
+ Requires-Dist: fastled-wasm-server>=1.0.23
24
24
  Dynamic: home-page
25
25
  Dynamic: license-file
26
26
  Dynamic: maintainer
@@ -1,11 +1,11 @@
1
- fastled/__init__.py,sha256=vYwDrL6zVfgQu7tvm1TvpWJI5cqoR7U7dmPU3zEl1V0,7044
2
- fastled/app.py,sha256=LyQXHmIjK8aqel9sDRmzSHjnOiaITbsnGPoz6IDXQFc,6032
1
+ fastled/__init__.py,sha256=VvY5QdvHcJ-Lv876jDXi030MtomWs60ECdy_GqXGzRQ,7043
2
+ fastled/app.py,sha256=1N5Q486YccaWCRqnaI2F04ktL64NAVjAN6i4c-zgm1o,5818
3
3
  fastled/cli.py,sha256=5EBsb02ueFUjlgrlg0GMdj3e5nnHVhvofmYyQRaw8uM,565
4
4
  fastled/cli_test.py,sha256=qJB9yLRFR3OwOwdIWSQ0fQsWLnA37v5pDccufiP_hTs,512
5
5
  fastled/cli_test_interactive.py,sha256=BjNhveZOk5aCffHbcrxPQQjWmAuj4ClVKKcKX5eY6yM,542
6
6
  fastled/client_server.py,sha256=falqUhGSHQpNfEXNCcQFPDAZymfncEVhIDcURBIJTFk,18390
7
- fastled/compile_server.py,sha256=sRiXYzw7lv9vcWJWGPUkzOGZPmvZGV_TGwbHYoRc15s,3155
8
- fastled/compile_server_impl.py,sha256=FxTuQTojpA7j59v7zSGh1LEeG4Yu0MFgW9SKfHpspQg,13243
7
+ fastled/compile_server.py,sha256=rkXvrvdav5vDG8lv_OlBX3YSCHtnHMt25nXbfeg_r78,2960
8
+ fastled/compile_server_impl.py,sha256=MIe-GvKenoDaqX8VhCJ7KNIWTOHHcLPgUQ7kO6lsa38,12199
9
9
  fastled/docker_manager.py,sha256=6zg1JcrBFj0fbFc1adPoT6_8GE0YFAPHG80Cf7ytYGE,37139
10
10
  fastled/filewatcher.py,sha256=3qS3L7zMQhFuVrkeGn1djsB_cB6x_E2YGJmmQWVAU_w,10033
11
11
  fastled/keyboard.py,sha256=UTAsqCn1UMYnB8YDzENiLTj4GeL45tYfEcO7_5fLFEg,3556
@@ -17,7 +17,7 @@ fastled/paths.py,sha256=VsPmgu0lNSCFOoEC0BsTYzDygXqy15AHUfN-tTuzDZA,99
17
17
  fastled/print_filter.py,sha256=B0v493WAFN8DgG7aqM8iXMqI_V1EdMMvOnNQ26JNUxU,5499
18
18
  fastled/project_init.py,sha256=bBt4DwmW5hZkm9ICt9Qk-0Nr_0JQM7icCgH5Iv-bCQs,3984
19
19
  fastled/select_sketch_directory.py,sha256=-eudwCns3AKj4HuHtSkZAFwbnf005SNL07pOzs9VxnE,1383
20
- fastled/server_flask.py,sha256=xwoBJ0-biUGK26thUfZLtU0DK9evWz-YmhCs5z_eVz0,17456
20
+ fastled/server_flask.py,sha256=QOH-Lo5UDFAACpA8wzbBSIFpLjM5F7tshpX5CUbvV4k,17689
21
21
  fastled/server_start.py,sha256=W9yKStkRlRNuXeV6j_6O7HjjFPyVLBHMcF9Uy2QjDWQ,479
22
22
  fastled/settings.py,sha256=dUVyJ8Mtprg0RwaS6oMWP8jBhr4C3R8fu4Hdx_Z1lCM,577
23
23
  fastled/sketch.py,sha256=Ftbh55Nt-p4hmPuPpj8Q9HrMzvnUazhoG_q9FHcxkns,3473
@@ -25,7 +25,7 @@ fastled/spinner.py,sha256=VHxmvB92P0Z_zYxRajb5HiNmkHHvZ5dG7hKtZltzpcs,867
25
25
  fastled/string_diff.py,sha256=NbtYxvBFxTUdmTpMLizlgZj2ULJ-7etj72GBdWDTGws,2496
26
26
  fastled/types.py,sha256=k1j1y5h1zpRonp1mqRXy797mSbLqzf5K1QEgl8f27jQ,4822
27
27
  fastled/util.py,sha256=hw3gxS1qGc5LL_QN88_VIjut6T0-61ImDQpxGp11DXY,1189
28
- fastled/web_compile.py,sha256=QTYHtcm55zsFxPhdA-qSPfL5Q4lhL3h3oNmir3m-Y3s,11345
28
+ fastled/web_compile.py,sha256=R159Od1VqeXTW6y3rQY0_P9f0CJYbPuBiMLqb-zBCUQ,11526
29
29
  fastled/assets/example.txt,sha256=lTBovRjiz0_TgtAtbA1C5hNi2ffbqnNPqkKg6UiKCT8,54
30
30
  fastled/assets/localhost-key.pem,sha256=Q-CNO_UoOd8fFNN4ljcnqwUeCMhzTplRjLO2x0pYRlU,1704
31
31
  fastled/assets/localhost.pem,sha256=QTwUtTwjYWbm9m3pHW2IlK2nFZJ8b0pppxPjhgVZqQo,1619
@@ -33,9 +33,9 @@ fastled/site/build.py,sha256=2YKU_UWKlJdGnjdbAbaL0co6kceFMSTVYwH1KCmgPZA,13987
33
33
  fastled/site/examples.py,sha256=s6vj2zJc6BfKlnbwXr1QWY1mzuDBMt6j5MEBOWjO_U8,155
34
34
  fastled/test/can_run_local_docker_tests.py,sha256=LEuUbHctRhNNFWcvnz2kEGmjDJeXO4c3kNpizm3yVJs,400
35
35
  fastled/test/examples.py,sha256=GfaHeY1E8izBl6ZqDVjz--RHLyVR4NRnQ5pBesCFJFY,1673
36
- fastled-1.2.99.dist-info/licenses/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
37
- fastled-1.2.99.dist-info/METADATA,sha256=2gaE-w-tsceFLsldUpX9ZGGfiltCAIHitZRbESYw7rI,30050
38
- fastled-1.2.99.dist-info/WHEEL,sha256=A8Eltl-h0W-qZDVezsLjjslosEH_pdYC2lQ0JcbgCzs,91
39
- fastled-1.2.99.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
40
- fastled-1.2.99.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
41
- fastled-1.2.99.dist-info/RECORD,,
36
+ fastled-1.3.1.dist-info/licenses/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
37
+ fastled-1.3.1.dist-info/METADATA,sha256=p2QjWihOI6WOjdqcCoItvChi9O-hcvR0IYbN80pHJPg,30049
38
+ fastled-1.3.1.dist-info/WHEEL,sha256=QZxptf4Y1BKFRCEDxD4h2V0mBFQOVFLFEpvxHmIs52A,91
39
+ fastled-1.3.1.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
40
+ fastled-1.3.1.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
41
+ fastled-1.3.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.7.0)
2
+ Generator: setuptools (80.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5