fastled 1.2.19__tar.gz → 1.2.20__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 (83) hide show
  1. {fastled-1.2.19 → fastled-1.2.20}/PKG-INFO +2 -1
  2. {fastled-1.2.19 → fastled-1.2.20}/README.md +1 -0
  3. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/__init__.py +2 -2
  4. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/compile_server.py +6 -1
  5. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/open_browser.py +24 -1
  6. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/open_browser2.py +3 -0
  7. {fastled-1.2.19 → fastled-1.2.20}/src/fastled.egg-info/PKG-INFO +2 -1
  8. {fastled-1.2.19 → fastled-1.2.20}/.aiderignore +0 -0
  9. {fastled-1.2.19 → fastled-1.2.20}/.github/workflows/build_multi_docker_image.yml +0 -0
  10. {fastled-1.2.19 → fastled-1.2.20}/.github/workflows/build_webpage.yml +0 -0
  11. {fastled-1.2.19 → fastled-1.2.20}/.github/workflows/lint.yml +0 -0
  12. {fastled-1.2.19 → fastled-1.2.20}/.github/workflows/publish_release.yml +0 -0
  13. {fastled-1.2.19 → fastled-1.2.20}/.github/workflows/test_build_exe.yml +0 -0
  14. {fastled-1.2.19 → fastled-1.2.20}/.github/workflows/test_macos.yml +0 -0
  15. {fastled-1.2.19 → fastled-1.2.20}/.github/workflows/test_ubuntu.yml +0 -0
  16. {fastled-1.2.19 → fastled-1.2.20}/.github/workflows/test_win.yml +0 -0
  17. {fastled-1.2.19 → fastled-1.2.20}/.gitignore +0 -0
  18. {fastled-1.2.19 → fastled-1.2.20}/.pylintrc +0 -0
  19. {fastled-1.2.19 → fastled-1.2.20}/.vscode/launch.json +0 -0
  20. {fastled-1.2.19 → fastled-1.2.20}/.vscode/settings.json +0 -0
  21. {fastled-1.2.19 → fastled-1.2.20}/.vscode/tasks.json +0 -0
  22. {fastled-1.2.19 → fastled-1.2.20}/LICENSE +0 -0
  23. {fastled-1.2.19 → fastled-1.2.20}/MANIFEST.in +0 -0
  24. {fastled-1.2.19 → fastled-1.2.20}/RELEASE.md +0 -0
  25. {fastled-1.2.19 → fastled-1.2.20}/TODO.md +0 -0
  26. {fastled-1.2.19 → fastled-1.2.20}/build_exe.py +0 -0
  27. {fastled-1.2.19 → fastled-1.2.20}/build_site.py +0 -0
  28. {fastled-1.2.19 → fastled-1.2.20}/clean +0 -0
  29. {fastled-1.2.19 → fastled-1.2.20}/install +0 -0
  30. {fastled-1.2.19 → fastled-1.2.20}/lint +0 -0
  31. {fastled-1.2.19 → fastled-1.2.20}/pyproject.toml +0 -0
  32. {fastled-1.2.19 → fastled-1.2.20}/requirements.testing.txt +0 -0
  33. {fastled-1.2.19 → fastled-1.2.20}/setup.cfg +0 -0
  34. {fastled-1.2.19 → fastled-1.2.20}/setup.py +0 -0
  35. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/app.py +0 -0
  36. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/assets/example.txt +0 -0
  37. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/cli.py +0 -0
  38. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/client_server.py +0 -0
  39. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/compile_server_impl.py +0 -0
  40. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/docker_manager.py +0 -0
  41. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/filewatcher.py +0 -0
  42. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/keyboard.py +0 -0
  43. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/live_client.py +0 -0
  44. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/parse_args.py +0 -0
  45. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/paths.py +0 -0
  46. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/project_init.py +0 -0
  47. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/select_sketch_directory.py +0 -0
  48. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/settings.py +0 -0
  49. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/site/build.py +0 -0
  50. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/sketch.py +0 -0
  51. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/spinner.py +0 -0
  52. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/string_diff.py +0 -0
  53. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/test/can_run_local_docker_tests.py +0 -0
  54. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/test/examples.py +0 -0
  55. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/types.py +0 -0
  56. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/util.py +0 -0
  57. {fastled-1.2.19 → fastled-1.2.20}/src/fastled/web_compile.py +0 -0
  58. {fastled-1.2.19 → fastled-1.2.20}/src/fastled.egg-info/SOURCES.txt +0 -0
  59. {fastled-1.2.19 → fastled-1.2.20}/src/fastled.egg-info/dependency_links.txt +0 -0
  60. {fastled-1.2.19 → fastled-1.2.20}/src/fastled.egg-info/entry_points.txt +0 -0
  61. {fastled-1.2.19 → fastled-1.2.20}/src/fastled.egg-info/requires.txt +0 -0
  62. {fastled-1.2.19 → fastled-1.2.20}/src/fastled.egg-info/top_level.txt +0 -0
  63. {fastled-1.2.19 → fastled-1.2.20}/test +0 -0
  64. {fastled-1.2.19 → fastled-1.2.20}/tests/html/index.html +0 -0
  65. {fastled-1.2.19 → fastled-1.2.20}/tests/test_api.py +0 -0
  66. {fastled-1.2.19 → fastled-1.2.20}/tests/test_bad_ino.py +0 -0
  67. {fastled-1.2.19 → fastled-1.2.20}/tests/test_build.py +0 -0
  68. {fastled-1.2.19 → fastled-1.2.20}/tests/test_build_examples.py +0 -0
  69. {fastled-1.2.19 → fastled-1.2.20}/tests/test_cli.py +0 -0
  70. {fastled-1.2.19 → fastled-1.2.20}/tests/test_compile_server.py +0 -0
  71. {fastled-1.2.19 → fastled-1.2.20}/tests/test_docker_linux_on_windows.py +0 -0
  72. {fastled-1.2.19 → fastled-1.2.20}/tests/test_embedded_data.py +0 -0
  73. {fastled-1.2.19 → fastled-1.2.20}/tests/test_examples.py +0 -0
  74. {fastled-1.2.19 → fastled-1.2.20}/tests/test_filechanger.py +0 -0
  75. {fastled-1.2.19 → fastled-1.2.20}/tests/test_http_server.py +0 -0
  76. {fastled-1.2.19 → fastled-1.2.20}/tests/test_ino/bad/bad.ino +0 -0
  77. {fastled-1.2.19 → fastled-1.2.20}/tests/test_ino/embedded/data/bigdata.dat +0 -0
  78. {fastled-1.2.19 → fastled-1.2.20}/tests/test_ino/embedded/wasm.ino +0 -0
  79. {fastled-1.2.19 → fastled-1.2.20}/tests/test_ino/wasm/wasm.ino +0 -0
  80. {fastled-1.2.19 → fastled-1.2.20}/tests/test_project_init.py +0 -0
  81. {fastled-1.2.19 → fastled-1.2.20}/tests/test_server_and_client_seperatly.py +0 -0
  82. {fastled-1.2.19 → fastled-1.2.20}/tests/test_webcompile.py +0 -0
  83. {fastled-1.2.19 → fastled-1.2.20}/upload_package.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastled
3
- Version: 1.2.19
3
+ Version: 1.2.20
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -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.20 - Fixed up path issue for web browser launch for hot reload.
288
289
  * 1.2.19 - Compilation failure now overwrites the index.html file with error message.
289
290
  * 1.2.16 - Force mime types in web browser as some users may not have it correct in their registry.
290
291
  * 1.2.15 - Rewrote http server using flask. Reduced install size significantly.
@@ -262,6 +262,7 @@ A: A big chunk of space is being used by unnecessary javascript `emscripten` bun
262
262
 
263
263
  # Revisions
264
264
 
265
+ * 1.2.20 - Fixed up path issue for web browser launch for hot reload.
265
266
  * 1.2.19 - Compilation failure now overwrites the index.html file with error message.
266
267
  * 1.2.16 - Force mime types in web browser as some users may not have it correct in their registry.
267
268
  * 1.2.15 - Rewrote http server using flask. Reduced install size significantly.
@@ -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.19"
18
+ __version__ = "1.2.20"
19
19
 
20
20
 
21
21
  class Api:
@@ -317,7 +317,7 @@ class Test:
317
317
  @staticmethod
318
318
  def spawn_http_server(
319
319
  directory: Path | str = Path("."),
320
- port: int = 8000,
320
+ port: int | None = None,
321
321
  open_browser: bool = True,
322
322
  ) -> Process:
323
323
  from fastled.open_browser import open_browser_process
@@ -81,7 +81,12 @@ class CompileServer:
81
81
  return self.impl._start()
82
82
 
83
83
  def stop(self) -> None:
84
- return self.impl.stop()
84
+ try:
85
+ return self.impl.stop()
86
+ except KeyboardInterrupt:
87
+ import _thread
88
+
89
+ _thread.interrupt_main()
85
90
 
86
91
  def process_running(self) -> bool:
87
92
  return self.impl.process_running()
@@ -36,10 +36,33 @@ def open_http_server_subprocess(
36
36
  _thread.interrupt_main()
37
37
 
38
38
 
39
+ def is_port_free(port: int) -> bool:
40
+ """Check if a port is free"""
41
+ import socket
42
+
43
+ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
44
+ return s.connect_ex(("localhost", port)) != 0
45
+
46
+
47
+ def find_free_port(start_port: int) -> int:
48
+ """Find a free port starting at start_port"""
49
+ for port in range(start_port, start_port + 100):
50
+ if is_port_free(port):
51
+ print(f"Found free port: {port}")
52
+ return port
53
+ else:
54
+ print(f"Port {port} is in use, finding next")
55
+ raise ValueError("Could not find a free port")
56
+
57
+
39
58
  def open_browser_process(
40
- fastled_js: Path, port: int = DEFAULT_PORT, open_browser: bool = True
59
+ fastled_js: Path, port: int | None = None, open_browser: bool = True
41
60
  ) -> Process:
42
61
  """Start livereload server in the fastled_js directory and return the process"""
62
+ if port is not None:
63
+ if not is_port_free(port):
64
+ raise ValueError(f"Port {port} was specified but in use in use")
65
+ port = port or find_free_port(DEFAULT_PORT)
43
66
  out: Process = Process(
44
67
  target=open_http_server_subprocess,
45
68
  args=(fastled_js, port, open_browser),
@@ -12,6 +12,9 @@ def _run_flask_server(fastled_js: Path, port: int) -> None:
12
12
 
13
13
  app = Flask(__name__)
14
14
 
15
+ # Must be a full path or flask will fail to find the file.
16
+ fastled_js = fastled_js.resolve()
17
+
15
18
  @app.route("/")
16
19
  def serve_index():
17
20
  return send_from_directory(fastled_js, "index.html")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastled
3
- Version: 1.2.19
3
+ Version: 1.2.20
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -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.20 - Fixed up path issue for web browser launch for hot reload.
288
289
  * 1.2.19 - Compilation failure now overwrites the index.html file with error message.
289
290
  * 1.2.16 - Force mime types in web browser as some users may not have it correct in their registry.
290
291
  * 1.2.15 - Rewrote http server using flask. Reduced install size significantly.
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