fastled 1.2.15__py3-none-any.whl → 1.2.17__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
@@ -15,7 +15,7 @@ from .types import BuildMode, CompileResult, CompileServerError
15
15
  # IMPORTANT! There's a bug in github which will REJECT any version update
16
16
  # that has any other change in the repo. Please bump the version as the
17
17
  # ONLY change in a commit, or else the pypi update and the release will fail.
18
- __version__ = "1.2.15"
18
+ __version__ = "1.2.17"
19
19
 
20
20
 
21
21
  class Api:
fastled/open_browser2.py CHANGED
@@ -18,9 +18,37 @@ def _run_flask_server(fastled_js: Path, port: int) -> None:
18
18
 
19
19
  @app.route("/<path:path>")
20
20
  def serve_files(path):
21
- return send_from_directory(fastled_js, path)
21
+ response = send_from_directory(fastled_js, path)
22
+ # Some servers don't set the Content-Type header for a bunch of files.
23
+ if path.endswith(".js"):
24
+ response.headers["Content-Type"] = "application/javascript"
25
+ if path.endswith(".css"):
26
+ response.headers["Content-Type"] = "text/css"
27
+ if path.endswith(".wasm"):
28
+ response.headers["Content-Type"] = "application/wasm"
29
+ if path.endswith(".json"):
30
+ response.headers["Content-Type"] = "application/json"
31
+ if path.endswith(".png"):
32
+ response.headers["Content-Type"] = "image/png"
33
+ if path.endswith(".jpg"):
34
+ response.headers["Content-Type"] = "image/jpeg"
35
+ if path.endswith(".jpeg"):
36
+ response.headers["Content-Type"] = "image/jpeg"
37
+ if path.endswith(".gif"):
38
+ response.headers["Content-Type"] = "image/gif"
39
+ if path.endswith(".svg"):
40
+ response.headers["Content-Type"] = "image/svg+xml"
41
+ if path.endswith(".ico"):
42
+ response.headers["Content-Type"] = "image/x-icon"
43
+ if path.endswith(".html"):
44
+ response.headers["Content-Type"] = "text/html"
45
+ return response
22
46
 
23
47
  app.run(port=port, debug=True)
48
+ except KeyboardInterrupt:
49
+ import _thread
50
+
51
+ _thread.interrupt_main()
24
52
  except Exception as e:
25
53
  print(f"Failed to run Flask server: {e}")
26
54
  import _thread
@@ -48,12 +76,18 @@ def wait_for_server_then_launch_browser(port: int) -> None:
48
76
 
49
77
  def run(path: Path, port: int, open_browser: bool) -> None:
50
78
  """Run the Flask server."""
51
- if open_browser:
52
- browser_thread = Thread(
53
- target=wait_for_server_then_launch_browser, args=(port,), daemon=True
54
- )
55
- browser_thread.start()
56
- _run_flask_server(path, port)
79
+ try:
80
+ if open_browser:
81
+ browser_thread = Thread(
82
+ target=wait_for_server_then_launch_browser, args=(port,), daemon=True
83
+ )
84
+ browser_thread.start()
85
+ _run_flask_server(path, port)
86
+ except KeyboardInterrupt:
87
+ import _thread
88
+
89
+ _thread.interrupt_main()
90
+ pass
57
91
 
58
92
 
59
93
  def parse_args() -> argparse.Namespace:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastled
3
- Version: 1.2.15
3
+ Version: 1.2.17
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -34,11 +34,14 @@ Requires-Dist: Flask>=3.0.0
34
34
  [![Build Webpage](https://github.com/zackees/fastled-wasm/actions/workflows/build_webpage.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/build_webpage.yml)
35
35
 
36
36
 
37
-
38
37
  ## Compile your FastLED sketch and run it on the Browser!
39
38
 
40
39
  ![image](https://github.com/user-attachments/assets/243aeb4d-e42f-4cc3-9c31-0af51271f3e0)
41
40
 
41
+ # Demo
42
+
43
+ https://zackees.github.io/fastled-wasm/
44
+
42
45
 
43
46
  # About
44
47
 
@@ -50,9 +53,6 @@ If you have docker installed, the compiler will download the docker image and ru
50
53
 
51
54
  In every conceivable way, the local compiler will be much faster than the web version.
52
55
 
53
- # Demo
54
-
55
- https://zackees.github.io/fastled-wasm/
56
56
 
57
57
  # Install
58
58
 
@@ -285,6 +285,7 @@ A: A big chunk of space is being used by unnecessary javascript `emscripten` bun
285
285
 
286
286
  # Revisions
287
287
 
288
+ * 1.2.16 - Force mime types in web browser as some users may not have it correct in their registry.
288
289
  * 1.2.15 - Rewrote http server using flask. Reduced install size significantly.
289
290
  * 1.2.13 - More fixes for npm live-server, now uses `static-npm` to launch it.
290
291
  * 1.2.12 - Fixes for python npm for launching live-server
@@ -1,4 +1,4 @@
1
- fastled/__init__.py,sha256=JnLfhQLDaf8tYBJsd0h5HLf99HLd7rITdZkxU5Qu5wA,10743
1
+ fastled/__init__.py,sha256=Pbq9T8vJkKZZRdcC21f8E_TiVy22urNQewotJnWOTkI,10743
2
2
  fastled/app.py,sha256=4LQHjN-GMAzhEaIKSFkT5S26Snb1Y9kgVnPK6kqXbrQ,3382
3
3
  fastled/cli.py,sha256=FjVr31ht0UPlAcmX-84NwfAGMQHTkrCe4o744jCAxiw,375
4
4
  fastled/client_server.py,sha256=8L62zNtkGtErDtWrr4XVNsv7ji2zoS5rlqfCnwI3VKU,13177
@@ -9,7 +9,7 @@ fastled/filewatcher.py,sha256=LwEQJkqADsArZyY499RLAer6JjJyDwaQBcAvT7xmp3c,6708
9
9
  fastled/keyboard.py,sha256=vyYxE98WCXjvMpcUJd0YXPVvt7TzvBmifLYI-K7jtKg,3524
10
10
  fastled/live_client.py,sha256=b9mVJ-8w_zoEDwKIlAEUC5Q1La5W5rR6ct-exOcgJec,2561
11
11
  fastled/open_browser.py,sha256=k7J_wQcS1rq0vx0we5pnWEqApJrPSbScDo0eS5h-wxE,1571
12
- fastled/open_browser2.py,sha256=CP-2OnjNTc60eQeJHUIM2lMv9YwkQdnMBPvp5WQhmgw,2463
12
+ fastled/open_browser2.py,sha256=VtuTw7p2T8RLqbP34fRa-JNerv8EDpJnspaNL270s-Y,3947
13
13
  fastled/parse_args.py,sha256=LD2PpSEhyq3ZqPWa_TJ90Fb-O-yldi7rnen2fWLOPjo,6868
14
14
  fastled/paths.py,sha256=VsPmgu0lNSCFOoEC0BsTYzDygXqy15AHUfN-tTuzDZA,99
15
15
  fastled/project_init.py,sha256=bBt4DwmW5hZkm9ICt9Qk-0Nr_0JQM7icCgH5Iv-bCQs,3984
@@ -25,9 +25,9 @@ fastled/assets/example.txt,sha256=lTBovRjiz0_TgtAtbA1C5hNi2ffbqnNPqkKg6UiKCT8,54
25
25
  fastled/site/build.py,sha256=l4RajIk0bApiAifT1lyLjIZi9lpPtSba4cnwWP5UOKc,14064
26
26
  fastled/test/can_run_local_docker_tests.py,sha256=LEuUbHctRhNNFWcvnz2kEGmjDJeXO4c3kNpizm3yVJs,400
27
27
  fastled/test/examples.py,sha256=6xPwx_k9_XwYTpI1nk4SrYbsJKHJACd30GzD1epGqhY,1597
28
- fastled-1.2.15.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
29
- fastled-1.2.15.dist-info/METADATA,sha256=2G4Tg-XMxTtRZB5z-qX-xpU53OFh2UBroqRutys0cMM,20496
30
- fastled-1.2.15.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
31
- fastled-1.2.15.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
32
- fastled-1.2.15.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
33
- fastled-1.2.15.dist-info/RECORD,,
28
+ fastled-1.2.17.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
29
+ fastled-1.2.17.dist-info/METADATA,sha256=2mwtfCI_EzEgonoVvlMFHCxScDcqYmWbR4qXy_jXf0Y,20598
30
+ fastled-1.2.17.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
31
+ fastled-1.2.17.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
32
+ fastled-1.2.17.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
33
+ fastled-1.2.17.dist-info/RECORD,,