fastled 1.2.61__tar.gz → 1.2.63__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 (128) hide show
  1. {fastled-1.2.61 → fastled-1.2.63}/PKG-INFO +3 -1
  2. fastled-1.2.63/compiler/extra/mp3upload.html +38 -0
  3. {fastled-1.2.61 → fastled-1.2.63}/pyproject.toml +2 -0
  4. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/__init__.py +1 -1
  5. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/open_browser.py +1 -1
  6. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/server_fastapi_cli.py +1 -1
  7. fastled-1.2.63/src/fastled/server_flask.py +152 -0
  8. fastled-1.2.61/src/fastled/open_browser2.py → fastled-1.2.63/src/fastled/server_start.py +63 -12
  9. {fastled-1.2.61 → fastled-1.2.63}/src/fastled.egg-info/PKG-INFO +3 -1
  10. {fastled-1.2.61 → fastled-1.2.63}/src/fastled.egg-info/SOURCES.txt +3 -1
  11. {fastled-1.2.61 → fastled-1.2.63}/src/fastled.egg-info/requires.txt +2 -0
  12. {fastled-1.2.61 → fastled-1.2.63}/.aiderignore +0 -0
  13. {fastled-1.2.61 → fastled-1.2.63}/.dockerignore +0 -0
  14. {fastled-1.2.61 → fastled-1.2.63}/.github/workflows/build_multi_docker_image.yml +0 -0
  15. {fastled-1.2.61 → fastled-1.2.63}/.github/workflows/build_webpage.yml +0 -0
  16. {fastled-1.2.61 → fastled-1.2.63}/.github/workflows/lint.yml +0 -0
  17. {fastled-1.2.61 → fastled-1.2.63}/.github/workflows/publish_release.yml +0 -0
  18. {fastled-1.2.61 → fastled-1.2.63}/.github/workflows/template_build_docker_image.yml +0 -0
  19. {fastled-1.2.61 → fastled-1.2.63}/.github/workflows/test_build_exe.yml +0 -0
  20. {fastled-1.2.61 → fastled-1.2.63}/.github/workflows/test_macos.yml +0 -0
  21. {fastled-1.2.61 → fastled-1.2.63}/.github/workflows/test_ubuntu.yml +0 -0
  22. {fastled-1.2.61 → fastled-1.2.63}/.github/workflows/test_win.yml +0 -0
  23. {fastled-1.2.61 → fastled-1.2.63}/.gitignore +0 -0
  24. {fastled-1.2.61 → fastled-1.2.63}/.pylintrc +0 -0
  25. {fastled-1.2.61 → fastled-1.2.63}/.vscode/launch.json +0 -0
  26. {fastled-1.2.61 → fastled-1.2.63}/.vscode/settings.json +0 -0
  27. {fastled-1.2.61 → fastled-1.2.63}/.vscode/tasks.json +0 -0
  28. {fastled-1.2.61 → fastled-1.2.63}/Dockerfile +0 -0
  29. {fastled-1.2.61 → fastled-1.2.63}/LICENSE +0 -0
  30. {fastled-1.2.61 → fastled-1.2.63}/MANIFEST.in +0 -0
  31. {fastled-1.2.61 → fastled-1.2.63}/README.md +0 -0
  32. {fastled-1.2.61 → fastled-1.2.63}/RELEASE.md +0 -0
  33. {fastled-1.2.61 → fastled-1.2.63}/TODO.md +0 -0
  34. {fastled-1.2.61 → fastled-1.2.63}/build_exe.py +0 -0
  35. {fastled-1.2.61 → fastled-1.2.63}/build_site.py +0 -0
  36. {fastled-1.2.61 → fastled-1.2.63}/clean +0 -0
  37. {fastled-1.2.61 → fastled-1.2.63}/compiler/CMakeLists.txt +0 -0
  38. {fastled-1.2.61 → fastled-1.2.63}/compiler/__init__.py +0 -0
  39. {fastled-1.2.61 → fastled-1.2.63}/compiler/arduino-pre-process.sh +0 -0
  40. {fastled-1.2.61 → fastled-1.2.63}/compiler/build.sh +0 -0
  41. {fastled-1.2.61 → fastled-1.2.63}/compiler/build_archive.sh +0 -0
  42. {fastled-1.2.61 → fastled-1.2.63}/compiler/build_fast.sh +0 -0
  43. {fastled-1.2.61 → fastled-1.2.63}/compiler/code_sync.py +0 -0
  44. {fastled-1.2.61 → fastled-1.2.63}/compiler/compile.py +0 -0
  45. {fastled-1.2.61 → fastled-1.2.63}/compiler/compile_lock.py +0 -0
  46. {fastled-1.2.61 → fastled-1.2.63}/compiler/entrypoint.sh +0 -0
  47. {fastled-1.2.61 → fastled-1.2.63}/compiler/extra/100dots.html +0 -0
  48. {fastled-1.2.61 → fastled-1.2.63}/compiler/extra/demo_threejs.html +0 -0
  49. {fastled-1.2.61 → fastled-1.2.63}/compiler/extra/micdemo.html +0 -0
  50. {fastled-1.2.61 → fastled-1.2.63}/compiler/extra/webgl_postprocessing_unreal_bloom.html +0 -0
  51. {fastled-1.2.61 → fastled-1.2.63}/compiler/final_prewarm.sh +0 -0
  52. {fastled-1.2.61 → fastled-1.2.63}/compiler/init_runtime.py +0 -0
  53. {fastled-1.2.61 → fastled-1.2.63}/compiler/install-arduino-cli.sh +0 -0
  54. {fastled-1.2.61 → fastled-1.2.63}/compiler/libcompile/CMakeLists.txt +0 -0
  55. {fastled-1.2.61 → fastled-1.2.63}/compiler/paths.py +0 -0
  56. {fastled-1.2.61 → fastled-1.2.63}/compiler/pre-process.sh +0 -0
  57. {fastled-1.2.61 → fastled-1.2.63}/compiler/prewarm.sh +0 -0
  58. {fastled-1.2.61 → fastled-1.2.63}/compiler/process-ino.py +0 -0
  59. {fastled-1.2.61 → fastled-1.2.63}/compiler/process_extended.py +0 -0
  60. {fastled-1.2.61 → fastled-1.2.63}/compiler/pyproject.toml +0 -0
  61. {fastled-1.2.61 → fastled-1.2.63}/compiler/run.py +0 -0
  62. {fastled-1.2.61 → fastled-1.2.63}/compiler/server.py +0 -0
  63. {fastled-1.2.61 → fastled-1.2.63}/compiler/sketch_hasher.py +0 -0
  64. {fastled-1.2.61 → fastled-1.2.63}/compiler/wasm_compiler_flags.py +0 -0
  65. {fastled-1.2.61 → fastled-1.2.63}/docker-compose.yml +0 -0
  66. {fastled-1.2.61 → fastled-1.2.63}/install +0 -0
  67. {fastled-1.2.61 → fastled-1.2.63}/install_linux.sh +0 -0
  68. {fastled-1.2.61 → fastled-1.2.63}/lint +0 -0
  69. {fastled-1.2.61 → fastled-1.2.63}/requirements.testing.txt +0 -0
  70. {fastled-1.2.61 → fastled-1.2.63}/setup.cfg +0 -0
  71. {fastled-1.2.61 → fastled-1.2.63}/setup.py +0 -0
  72. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/app.py +0 -0
  73. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/assets/example.txt +0 -0
  74. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/assets/localhost-key.pem +0 -0
  75. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/assets/localhost.pem +0 -0
  76. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/cli.py +0 -0
  77. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/cli_test.py +0 -0
  78. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/client_server.py +0 -0
  79. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/compile_server.py +0 -0
  80. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/compile_server_impl.py +0 -0
  81. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/docker_manager.py +0 -0
  82. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/filewatcher.py +0 -0
  83. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/interactive_srcs.py +0 -0
  84. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/keyboard.py +0 -0
  85. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/keyz.py +0 -0
  86. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/live_client.py +0 -0
  87. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/parse_args.py +0 -0
  88. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/paths.py +0 -0
  89. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/project_init.py +0 -0
  90. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/select_sketch_directory.py +0 -0
  91. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/server_fastapi.py +0 -0
  92. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/settings.py +0 -0
  93. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/site/build.py +0 -0
  94. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/site/examples.py +0 -0
  95. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/sketch.py +0 -0
  96. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/spinner.py +0 -0
  97. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/string_diff.py +0 -0
  98. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/test/can_run_local_docker_tests.py +0 -0
  99. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/test/examples.py +0 -0
  100. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/types.py +0 -0
  101. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/util.py +0 -0
  102. {fastled-1.2.61 → fastled-1.2.63}/src/fastled/web_compile.py +0 -0
  103. {fastled-1.2.61 → fastled-1.2.63}/src/fastled.egg-info/dependency_links.txt +0 -0
  104. {fastled-1.2.61 → fastled-1.2.63}/src/fastled.egg-info/entry_points.txt +0 -0
  105. {fastled-1.2.61 → fastled-1.2.63}/src/fastled.egg-info/top_level.txt +0 -0
  106. {fastled-1.2.61 → fastled-1.2.63}/test +0 -0
  107. {fastled-1.2.61 → fastled-1.2.63}/tests/integration/test_build_examples.py +0 -0
  108. {fastled-1.2.61 → fastled-1.2.63}/tests/integration/test_examples.py +0 -0
  109. {fastled-1.2.61 → fastled-1.2.63}/tests/unit/html/index.html +0 -0
  110. {fastled-1.2.61 → fastled-1.2.63}/tests/unit/test_api.py +0 -0
  111. {fastled-1.2.61 → fastled-1.2.63}/tests/unit/test_bad_ino.py +0 -0
  112. {fastled-1.2.61 → fastled-1.2.63}/tests/unit/test_cli.py +0 -0
  113. {fastled-1.2.61 → fastled-1.2.63}/tests/unit/test_compile_server.py +0 -0
  114. {fastled-1.2.61 → fastled-1.2.63}/tests/unit/test_docker_linux_on_windows.py +0 -0
  115. {fastled-1.2.61 → fastled-1.2.63}/tests/unit/test_embedded_data.py +0 -0
  116. {fastled-1.2.61 → fastled-1.2.63}/tests/unit/test_filechanger.py +0 -0
  117. {fastled-1.2.61 → fastled-1.2.63}/tests/unit/test_http_server.py +0 -0
  118. {fastled-1.2.61 → fastled-1.2.63}/tests/unit/test_ino/bad/bad.ino +0 -0
  119. {fastled-1.2.61 → fastled-1.2.63}/tests/unit/test_ino/bad_platformio/bad_platformio.ino +0 -0
  120. {fastled-1.2.61 → fastled-1.2.63}/tests/unit/test_ino/bad_platformio/platformio.ini +0 -0
  121. {fastled-1.2.61 → fastled-1.2.63}/tests/unit/test_ino/embedded/data/bigdata.dat +0 -0
  122. {fastled-1.2.61 → fastled-1.2.63}/tests/unit/test_ino/embedded/wasm.ino +0 -0
  123. {fastled-1.2.61 → fastled-1.2.63}/tests/unit/test_ino/wasm/wasm.ino +0 -0
  124. {fastled-1.2.61 → fastled-1.2.63}/tests/unit/test_project_init.py +0 -0
  125. {fastled-1.2.61 → fastled-1.2.63}/tests/unit/test_server_and_client_seperatly.py +0 -0
  126. {fastled-1.2.61 → fastled-1.2.63}/tests/unit/test_string_diff.py +0 -0
  127. {fastled-1.2.61 → fastled-1.2.63}/tests/unit/test_webcompile.py +0 -0
  128. {fastled-1.2.61 → fastled-1.2.63}/upload_package.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastled
3
- Version: 1.2.61
3
+ Version: 1.2.63
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -23,6 +23,8 @@ Requires-Dist: fastapi>=0.115.12
23
23
  Requires-Dist: uvicorn>=0.34.2
24
24
  Requires-Dist: pywebview>=5.4
25
25
  Requires-Dist: watchfiles>=1.0.5
26
+ Requires-Dist: Flask>=3.0.0
27
+ Requires-Dist: livereload
26
28
  Dynamic: home-page
27
29
  Dynamic: license-file
28
30
  Dynamic: maintainer
@@ -0,0 +1,38 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>MP3 Upload & Play Demo</title>
6
+ </head>
7
+ <body>
8
+ <!-- Button that triggers the hidden file input -->
9
+ <button id="upload_mp3">upload_mp3</button>
10
+ <!-- Hidden file input, restricted to MP3 files -->
11
+ <input type="file" id="file_input" accept="audio/mpeg" style="display:none" />
12
+ <!-- Audio element, shown once a file is loaded -->
13
+ <audio id="player" controls style="display:none; margin-top:1em;"></audio>
14
+
15
+ <script>
16
+ const uploadBtn = document.getElementById('upload_mp3');
17
+ const fileInput = document.getElementById('file_input');
18
+ const player = document.getElementById('player');
19
+
20
+ // When our button is clicked, open the file picker
21
+ uploadBtn.addEventListener('click', () => {
22
+ fileInput.click();
23
+ });
24
+
25
+ // When a file is selected...
26
+ fileInput.addEventListener('change', (e) => {
27
+ const file = e.target.files[0];
28
+ if (!file) return;
29
+
30
+ // Create a temporary URL & set it on the audio element
31
+ const url = URL.createObjectURL(file);
32
+ player.src = url;
33
+ player.style.display = 'block'; // show the player
34
+ player.play(); // start playback
35
+ });
36
+ </script>
37
+ </body>
38
+ </html>
@@ -24,6 +24,8 @@ dependencies = [
24
24
  "uvicorn>=0.34.2",
25
25
  "pywebview>=5.4",
26
26
  "watchfiles>=1.0.5",
27
+ "Flask>=3.0.0",
28
+ "livereload",
27
29
  ]
28
30
 
29
31
  dynamic = ["version"]
@@ -13,7 +13,7 @@ from .types import BuildMode, CompileResult, CompileServerError
13
13
  # IMPORTANT! There's a bug in github which will REJECT any version update
14
14
  # that has any other change in the repo. Please bump the version as the
15
15
  # ONLY change in a commit, or else the pypi update and the release will fail.
16
- __version__ = "1.2.61"
16
+ __version__ = "1.2.63"
17
17
 
18
18
  DOCKER_FILE = (
19
19
  "https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/Dockerfile"
@@ -26,7 +26,7 @@ def _open_http_server_subprocess(
26
26
  cmd = [
27
27
  PYTHON_EXE,
28
28
  "-m",
29
- "fastled.open_browser2",
29
+ "fastled.server_start",
30
30
  str(fastled_js),
31
31
  "--port",
32
32
  str(port),
@@ -32,7 +32,7 @@ def _run_fastapi_server(
32
32
  "fastled.server_fastapi:app",
33
33
  host="127.0.0.1",
34
34
  port=port,
35
- reload=True,
35
+ reload=False,
36
36
  # reload_includes=["index.html"],
37
37
  ssl_certfile=certfile,
38
38
  ssl_keyfile=keyfile,
@@ -0,0 +1,152 @@
1
+ import argparse
2
+ from multiprocessing import Process
3
+ from pathlib import Path
4
+
5
+ from livereload import Server
6
+
7
+
8
+ def _run_flask_server(
9
+ fastled_js: Path,
10
+ port: int,
11
+ certfile: Path | None = None,
12
+ keyfile: Path | None = None,
13
+ ) -> None:
14
+ """Run Flask server with live reload in a subprocess
15
+
16
+ Args:
17
+ fastled_js: Path to the fastled_js directory
18
+ port: Port to run the server on
19
+ certfile: Path to the SSL certificate file
20
+ keyfile: Path to the SSL key file
21
+ """
22
+ try:
23
+ from flask import Flask, send_from_directory
24
+
25
+ app = Flask(__name__)
26
+
27
+ # Must be a full path or flask will fail to find the file.
28
+ fastled_js = fastled_js.resolve()
29
+
30
+ @app.route("/")
31
+ def serve_index():
32
+ return send_from_directory(fastled_js, "index.html")
33
+
34
+ @app.route("/<path:path>")
35
+ def serve_files(path):
36
+ response = send_from_directory(fastled_js, path)
37
+ # Some servers don't set the Content-Type header for a bunch of files.
38
+ if path.endswith(".js"):
39
+ response.headers["Content-Type"] = "application/javascript"
40
+ if path.endswith(".css"):
41
+ response.headers["Content-Type"] = "text/css"
42
+ if path.endswith(".wasm"):
43
+ response.headers["Content-Type"] = "application/wasm"
44
+ if path.endswith(".json"):
45
+ response.headers["Content-Type"] = "application/json"
46
+ if path.endswith(".png"):
47
+ response.headers["Content-Type"] = "image/png"
48
+ if path.endswith(".jpg"):
49
+ response.headers["Content-Type"] = "image/jpeg"
50
+ if path.endswith(".jpeg"):
51
+ response.headers["Content-Type"] = "image/jpeg"
52
+ if path.endswith(".gif"):
53
+ response.headers["Content-Type"] = "image/gif"
54
+ if path.endswith(".svg"):
55
+ response.headers["Content-Type"] = "image/svg+xml"
56
+ if path.endswith(".ico"):
57
+ response.headers["Content-Type"] = "image/x-icon"
58
+ if path.endswith(".html"):
59
+ response.headers["Content-Type"] = "text/html"
60
+
61
+ # now also add headers to force no caching
62
+ response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
63
+ response.headers["Pragma"] = "no-cache"
64
+ response.headers["Expires"] = "0"
65
+ return response
66
+
67
+ server = Server(app.wsgi_app)
68
+ # Watch index.html for changes
69
+ server.watch(str(fastled_js / "index.html"))
70
+ # server.watch(str(fastled_js / "index.js"))
71
+ # server.watch(str(fastled_js / "index.css"))
72
+ # Start the server
73
+ server.serve(port=port, debug=True)
74
+ except KeyboardInterrupt:
75
+ import _thread
76
+
77
+ _thread.interrupt_main()
78
+ except Exception as e:
79
+ print(f"Failed to run Flask server: {e}")
80
+ import _thread
81
+
82
+ _thread.interrupt_main()
83
+
84
+
85
+ def run(
86
+ port: int, cwd: Path, certfile: Path | None = None, keyfile: Path | None = None
87
+ ) -> None:
88
+ """Run the Flask server."""
89
+ try:
90
+ _run_flask_server(cwd, port, certfile, keyfile)
91
+ import warnings
92
+
93
+ warnings.warn("Flask server has stopped")
94
+ except KeyboardInterrupt:
95
+ import _thread
96
+
97
+ _thread.interrupt_main()
98
+ pass
99
+
100
+
101
+ def parse_args() -> argparse.Namespace:
102
+ """Parse the command line arguments."""
103
+ parser = argparse.ArgumentParser(
104
+ description="Open a browser to the fastled_js directory"
105
+ )
106
+ parser.add_argument(
107
+ "fastled_js", type=Path, help="Path to the fastled_js directory"
108
+ )
109
+ parser.add_argument(
110
+ "--port",
111
+ "-p",
112
+ type=int,
113
+ required=True,
114
+ help="Port to run the server on (default: %(default)s)",
115
+ )
116
+ parser.add_argument(
117
+ "--certfile",
118
+ type=Path,
119
+ help="Path to the SSL certificate file for HTTPS",
120
+ )
121
+ parser.add_argument(
122
+ "--keyfile",
123
+ type=Path,
124
+ help="Path to the SSL key file for HTTPS",
125
+ )
126
+ return parser.parse_args()
127
+
128
+
129
+ def run_flask_server_process(
130
+ port: int,
131
+ cwd: Path | None = None,
132
+ certfile: Path | None = None,
133
+ keyfile: Path | None = None,
134
+ ) -> Process:
135
+ """Run the Flask server in a separate process."""
136
+ cwd = cwd or Path(".")
137
+ process = Process(
138
+ target=run,
139
+ args=(port, cwd, certfile, keyfile),
140
+ )
141
+ process.start()
142
+ return process
143
+
144
+
145
+ def main() -> None:
146
+ """Main function."""
147
+ args = parse_args()
148
+ run(args.port, args.fastled_js, args.certfile, args.keyfile)
149
+
150
+
151
+ if __name__ == "__main__":
152
+ main()
@@ -1,8 +1,34 @@
1
1
  import argparse
2
2
  import importlib.resources as pkg_resources
3
+ from dataclasses import dataclass
4
+ from multiprocessing import Process
3
5
  from pathlib import Path
4
6
 
5
7
  from fastled.server_fastapi_cli import run_fastapi_server_process
8
+ from fastled.server_flask import run_flask_server_process
9
+
10
+
11
+ def run_server_process(
12
+ port: int, cwd: Path, certfile: Path | None = None, keyfile: Path | None = None
13
+ ) -> Process:
14
+ """Run the server in a separate process."""
15
+ if True:
16
+ # Use Flask server
17
+ process = run_flask_server_process(
18
+ port=port,
19
+ cwd=cwd,
20
+ certfile=certfile,
21
+ keyfile=keyfile,
22
+ )
23
+ else:
24
+ # Use FastAPI server
25
+ process = run_fastapi_server_process(
26
+ port=port,
27
+ cwd=cwd,
28
+ certfile=certfile,
29
+ keyfile=keyfile,
30
+ )
31
+ return process
6
32
 
7
33
 
8
34
  def get_asset_path(filename: str) -> Path | None:
@@ -16,12 +42,12 @@ def get_asset_path(filename: str) -> Path | None:
16
42
  return None
17
43
 
18
44
 
19
- def run(
45
+ def start_process(
20
46
  path: Path,
21
47
  port: int,
22
48
  certfile: Path | None = None,
23
49
  keyfile: Path | None = None,
24
- ) -> None:
50
+ ) -> Process:
25
51
  """Run the server, using package assets if explicit paths are not provided"""
26
52
  # Use package resources if no explicit path
27
53
  if certfile is None:
@@ -31,16 +57,25 @@ def run(
31
57
 
32
58
  # _run_flask_server(path, port, certfile, keyfile)
33
59
  # run_fastapi_server_process(port=port, path=path, certfile=certfile, keyfile=keyfile)
34
- proc = run_fastapi_server_process(port=port, cwd=path)
35
- try:
36
- proc.join()
37
- except KeyboardInterrupt:
38
- import _thread
60
+ proc = run_server_process(port=port, cwd=path)
61
+ # try:
62
+ # proc.join()
63
+ # except KeyboardInterrupt:
64
+ # import _thread
65
+
66
+ # _thread.interrupt_main()
67
+ return proc
39
68
 
40
- _thread.interrupt_main()
41
69
 
70
+ @dataclass
71
+ class Args:
72
+ fastled_js: Path
73
+ port: int
74
+ cert: Path | None
75
+ key: Path | None
42
76
 
43
- def parse_args() -> argparse.Namespace:
77
+
78
+ def parse_args() -> Args:
44
79
  parser = argparse.ArgumentParser(
45
80
  description="Open a browser to the fastled_js directory"
46
81
  )
@@ -60,21 +95,37 @@ def parse_args() -> argparse.Namespace:
60
95
  parser.add_argument(
61
96
  "--key", type=Path, help="(Optional) Path to SSL private key (PEM format)"
62
97
  )
63
- return parser.parse_args()
98
+ args = parser.parse_args()
99
+ out: Args = Args(
100
+ fastled_js=args.fastled_js,
101
+ port=args.port,
102
+ cert=args.cert,
103
+ key=args.key,
104
+ )
105
+ if args.fastled_js is None:
106
+ raise ValueError("fastled_js directory is required")
107
+ return out
64
108
 
65
109
 
66
110
  def main() -> None:
67
- args = parse_args()
111
+ args: Args = parse_args()
68
112
  fastled_js: Path = args.fastled_js
69
113
  port: int = args.port
70
114
  cert: Path | None = args.cert
71
115
  key: Path | None = args.key
72
- run(
116
+ proc = start_process(
73
117
  path=fastled_js,
74
118
  port=port,
75
119
  certfile=cert,
76
120
  keyfile=key,
77
121
  )
122
+ try:
123
+ proc.join()
124
+ except KeyboardInterrupt:
125
+ import _thread
126
+
127
+ _thread.interrupt_main()
128
+ pass
78
129
 
79
130
 
80
131
  if __name__ == "__main__":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastled
3
- Version: 1.2.61
3
+ Version: 1.2.63
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -23,6 +23,8 @@ Requires-Dist: fastapi>=0.115.12
23
23
  Requires-Dist: uvicorn>=0.34.2
24
24
  Requires-Dist: pywebview>=5.4
25
25
  Requires-Dist: watchfiles>=1.0.5
26
+ Requires-Dist: Flask>=3.0.0
27
+ Requires-Dist: livereload
26
28
  Dynamic: home-page
27
29
  Dynamic: license-file
28
30
  Dynamic: maintainer
@@ -58,6 +58,7 @@ compiler/wasm_compiler_flags.py
58
58
  compiler/extra/100dots.html
59
59
  compiler/extra/demo_threejs.html
60
60
  compiler/extra/micdemo.html
61
+ compiler/extra/mp3upload.html
61
62
  compiler/extra/webgl_postprocessing_unreal_bloom.html
62
63
  compiler/libcompile/CMakeLists.txt
63
64
  src/fastled/__init__.py
@@ -74,13 +75,14 @@ src/fastled/keyboard.py
74
75
  src/fastled/keyz.py
75
76
  src/fastled/live_client.py
76
77
  src/fastled/open_browser.py
77
- src/fastled/open_browser2.py
78
78
  src/fastled/parse_args.py
79
79
  src/fastled/paths.py
80
80
  src/fastled/project_init.py
81
81
  src/fastled/select_sketch_directory.py
82
82
  src/fastled/server_fastapi.py
83
83
  src/fastled/server_fastapi_cli.py
84
+ src/fastled/server_flask.py
85
+ src/fastled/server_start.py
84
86
  src/fastled/settings.py
85
87
  src/fastled/sketch.py
86
88
  src/fastled/spinner.py
@@ -11,3 +11,5 @@ fastapi>=0.115.12
11
11
  uvicorn>=0.34.2
12
12
  pywebview>=5.4
13
13
  watchfiles>=1.0.5
14
+ Flask>=3.0.0
15
+ livereload
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