fastled 1.2.20__tar.gz → 1.2.21__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.20 → fastled-1.2.21}/PKG-INFO +2 -1
  2. {fastled-1.2.20 → fastled-1.2.21}/pyproject.toml +1 -0
  3. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/__init__.py +4 -2
  4. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/open_browser.py +19 -3
  5. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/open_browser2.py +14 -35
  6. {fastled-1.2.20 → fastled-1.2.21}/src/fastled.egg-info/PKG-INFO +2 -1
  7. {fastled-1.2.20 → fastled-1.2.21}/src/fastled.egg-info/requires.txt +1 -0
  8. {fastled-1.2.20 → fastled-1.2.21}/.aiderignore +0 -0
  9. {fastled-1.2.20 → fastled-1.2.21}/.github/workflows/build_multi_docker_image.yml +0 -0
  10. {fastled-1.2.20 → fastled-1.2.21}/.github/workflows/build_webpage.yml +0 -0
  11. {fastled-1.2.20 → fastled-1.2.21}/.github/workflows/lint.yml +0 -0
  12. {fastled-1.2.20 → fastled-1.2.21}/.github/workflows/publish_release.yml +0 -0
  13. {fastled-1.2.20 → fastled-1.2.21}/.github/workflows/test_build_exe.yml +0 -0
  14. {fastled-1.2.20 → fastled-1.2.21}/.github/workflows/test_macos.yml +0 -0
  15. {fastled-1.2.20 → fastled-1.2.21}/.github/workflows/test_ubuntu.yml +0 -0
  16. {fastled-1.2.20 → fastled-1.2.21}/.github/workflows/test_win.yml +0 -0
  17. {fastled-1.2.20 → fastled-1.2.21}/.gitignore +0 -0
  18. {fastled-1.2.20 → fastled-1.2.21}/.pylintrc +0 -0
  19. {fastled-1.2.20 → fastled-1.2.21}/.vscode/launch.json +0 -0
  20. {fastled-1.2.20 → fastled-1.2.21}/.vscode/settings.json +0 -0
  21. {fastled-1.2.20 → fastled-1.2.21}/.vscode/tasks.json +0 -0
  22. {fastled-1.2.20 → fastled-1.2.21}/LICENSE +0 -0
  23. {fastled-1.2.20 → fastled-1.2.21}/MANIFEST.in +0 -0
  24. {fastled-1.2.20 → fastled-1.2.21}/README.md +0 -0
  25. {fastled-1.2.20 → fastled-1.2.21}/RELEASE.md +0 -0
  26. {fastled-1.2.20 → fastled-1.2.21}/TODO.md +0 -0
  27. {fastled-1.2.20 → fastled-1.2.21}/build_exe.py +0 -0
  28. {fastled-1.2.20 → fastled-1.2.21}/build_site.py +0 -0
  29. {fastled-1.2.20 → fastled-1.2.21}/clean +0 -0
  30. {fastled-1.2.20 → fastled-1.2.21}/install +0 -0
  31. {fastled-1.2.20 → fastled-1.2.21}/lint +0 -0
  32. {fastled-1.2.20 → fastled-1.2.21}/requirements.testing.txt +0 -0
  33. {fastled-1.2.20 → fastled-1.2.21}/setup.cfg +0 -0
  34. {fastled-1.2.20 → fastled-1.2.21}/setup.py +0 -0
  35. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/app.py +0 -0
  36. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/assets/example.txt +0 -0
  37. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/cli.py +0 -0
  38. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/client_server.py +0 -0
  39. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/compile_server.py +0 -0
  40. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/compile_server_impl.py +0 -0
  41. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/docker_manager.py +0 -0
  42. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/filewatcher.py +0 -0
  43. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/keyboard.py +0 -0
  44. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/live_client.py +0 -0
  45. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/parse_args.py +0 -0
  46. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/paths.py +0 -0
  47. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/project_init.py +0 -0
  48. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/select_sketch_directory.py +0 -0
  49. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/settings.py +0 -0
  50. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/site/build.py +0 -0
  51. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/sketch.py +0 -0
  52. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/spinner.py +0 -0
  53. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/string_diff.py +0 -0
  54. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/test/can_run_local_docker_tests.py +0 -0
  55. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/test/examples.py +0 -0
  56. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/types.py +0 -0
  57. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/util.py +0 -0
  58. {fastled-1.2.20 → fastled-1.2.21}/src/fastled/web_compile.py +0 -0
  59. {fastled-1.2.20 → fastled-1.2.21}/src/fastled.egg-info/SOURCES.txt +0 -0
  60. {fastled-1.2.20 → fastled-1.2.21}/src/fastled.egg-info/dependency_links.txt +0 -0
  61. {fastled-1.2.20 → fastled-1.2.21}/src/fastled.egg-info/entry_points.txt +0 -0
  62. {fastled-1.2.20 → fastled-1.2.21}/src/fastled.egg-info/top_level.txt +0 -0
  63. {fastled-1.2.20 → fastled-1.2.21}/test +0 -0
  64. {fastled-1.2.20 → fastled-1.2.21}/tests/html/index.html +0 -0
  65. {fastled-1.2.20 → fastled-1.2.21}/tests/test_api.py +0 -0
  66. {fastled-1.2.20 → fastled-1.2.21}/tests/test_bad_ino.py +0 -0
  67. {fastled-1.2.20 → fastled-1.2.21}/tests/test_build.py +0 -0
  68. {fastled-1.2.20 → fastled-1.2.21}/tests/test_build_examples.py +0 -0
  69. {fastled-1.2.20 → fastled-1.2.21}/tests/test_cli.py +0 -0
  70. {fastled-1.2.20 → fastled-1.2.21}/tests/test_compile_server.py +0 -0
  71. {fastled-1.2.20 → fastled-1.2.21}/tests/test_docker_linux_on_windows.py +0 -0
  72. {fastled-1.2.20 → fastled-1.2.21}/tests/test_embedded_data.py +0 -0
  73. {fastled-1.2.20 → fastled-1.2.21}/tests/test_examples.py +0 -0
  74. {fastled-1.2.20 → fastled-1.2.21}/tests/test_filechanger.py +0 -0
  75. {fastled-1.2.20 → fastled-1.2.21}/tests/test_http_server.py +0 -0
  76. {fastled-1.2.20 → fastled-1.2.21}/tests/test_ino/bad/bad.ino +0 -0
  77. {fastled-1.2.20 → fastled-1.2.21}/tests/test_ino/embedded/data/bigdata.dat +0 -0
  78. {fastled-1.2.20 → fastled-1.2.21}/tests/test_ino/embedded/wasm.ino +0 -0
  79. {fastled-1.2.20 → fastled-1.2.21}/tests/test_ino/wasm/wasm.ino +0 -0
  80. {fastled-1.2.20 → fastled-1.2.21}/tests/test_project_init.py +0 -0
  81. {fastled-1.2.20 → fastled-1.2.21}/tests/test_server_and_client_seperatly.py +0 -0
  82. {fastled-1.2.20 → fastled-1.2.21}/tests/test_webcompile.py +0 -0
  83. {fastled-1.2.20 → fastled-1.2.21}/upload_package.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastled
3
- Version: 1.2.20
3
+ Version: 1.2.21
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -20,6 +20,7 @@ Requires-Dist: appdirs>=1.4.4
20
20
  Requires-Dist: rapidfuzz>=3.10.1
21
21
  Requires-Dist: progress>=1.6
22
22
  Requires-Dist: Flask>=3.0.0
23
+ Requires-Dist: livereload
23
24
 
24
25
  # FastLED Wasm compiler
25
26
 
@@ -21,6 +21,7 @@ dependencies = [
21
21
  "rapidfuzz>=3.10.1",
22
22
  "progress>=1.6",
23
23
  "Flask>=3.0.0",
24
+ "livereload",
24
25
  ]
25
26
 
26
27
  dynamic = ["version"]
@@ -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.20"
18
+ __version__ = "1.2.21"
19
19
 
20
20
 
21
21
  class Api:
@@ -184,7 +184,9 @@ class Docker:
184
184
  )
185
185
  else:
186
186
  print(f"Cloning {url} into {output_dir}")
187
- subprocess.run(["git", "clone", url, str(output_dir)], check=True)
187
+ subprocess.run(
188
+ ["git", "clone", "--depth", "1", url, str(output_dir)], check=True
189
+ )
188
190
 
189
191
  dockerfile_path = (
190
192
  output_dir / "src" / "platforms" / "wasm" / "compiler" / "Dockerfile"
@@ -1,5 +1,8 @@
1
+ import socket
1
2
  import subprocess
2
3
  import sys
4
+ import time
5
+ import webbrowser
3
6
  from multiprocessing import Process
4
7
  from pathlib import Path
5
8
 
@@ -21,8 +24,6 @@ def open_http_server_subprocess(
21
24
  "--port",
22
25
  str(port),
23
26
  ]
24
- if not open_browser:
25
- cmd.append("--no-browser")
26
27
  # return subprocess.Popen(cmd) # type ignore
27
28
  # pipe stderr and stdout to null
28
29
  subprocess.run(
@@ -55,6 +56,16 @@ def find_free_port(start_port: int) -> int:
55
56
  raise ValueError("Could not find a free port")
56
57
 
57
58
 
59
+ def wait_for_server(port: int, timeout: int = 10) -> None:
60
+ """Wait for the server to start."""
61
+ future_time = time.time() + timeout
62
+ while future_time > time.time():
63
+ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
64
+ if sock.connect_ex(("localhost", port)) == 0:
65
+ return
66
+ raise TimeoutError("Could not connect to server")
67
+
68
+
58
69
  def open_browser_process(
59
70
  fastled_js: Path, port: int | None = None, open_browser: bool = True
60
71
  ) -> Process:
@@ -62,13 +73,18 @@ def open_browser_process(
62
73
  if port is not None:
63
74
  if not is_port_free(port):
64
75
  raise ValueError(f"Port {port} was specified but in use in use")
65
- port = port or find_free_port(DEFAULT_PORT)
76
+ else:
77
+ port = find_free_port(DEFAULT_PORT)
66
78
  out: Process = Process(
67
79
  target=open_http_server_subprocess,
68
80
  args=(fastled_js, port, open_browser),
69
81
  daemon=True,
70
82
  )
71
83
  out.start()
84
+ wait_for_server(port)
85
+ if open_browser:
86
+ print(f"Opening browser to http://localhost:{port}")
87
+ webbrowser.open(url=f"http://localhost:{port}", new=1, autoraise=True)
72
88
  return out
73
89
 
74
90
 
@@ -1,8 +1,7 @@
1
1
  import argparse
2
- import socket
3
- import time
4
2
  from pathlib import Path
5
- from threading import Thread
3
+
4
+ from livereload import Server
6
5
 
7
6
 
8
7
  def _run_flask_server(fastled_js: Path, port: int) -> None:
@@ -52,7 +51,13 @@ def _run_flask_server(fastled_js: Path, port: int) -> None:
52
51
  response.headers["Expires"] = "0"
53
52
  return response
54
53
 
55
- app.run(port=port, debug=True)
54
+ server = Server(app.wsgi_app)
55
+ # Watch index.html for changes
56
+ server.watch(str(fastled_js / "index.html"))
57
+ # server.watch(str(fastled_js / "index.js"))
58
+ # server.watch(str(fastled_js / "index.css"))
59
+ # Start the server
60
+ server.serve(port=port, debug=True)
56
61
  except KeyboardInterrupt:
57
62
  import _thread
58
63
 
@@ -64,33 +69,13 @@ def _run_flask_server(fastled_js: Path, port: int) -> None:
64
69
  _thread.interrupt_main()
65
70
 
66
71
 
67
- def wait_for_server(port: int, timeout: int = 10) -> None:
68
- """Wait for the server to start."""
69
- future_time = time.time() + timeout
70
- while future_time > time.time():
71
- with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
72
- if sock.connect_ex(("localhost", port)) == 0:
73
- return
74
- raise TimeoutError("Could not connect to server")
75
-
76
-
77
- def wait_for_server_then_launch_browser(port: int) -> None:
78
- """Wait for the server to start, then launch the browser."""
79
- wait_for_server(port)
80
- import webbrowser
81
-
82
- webbrowser.open(f"http://localhost:{port}")
83
-
84
-
85
- def run(path: Path, port: int, open_browser: bool) -> None:
72
+ def run(path: Path, port: int) -> None:
86
73
  """Run the Flask server."""
87
74
  try:
88
- if open_browser:
89
- browser_thread = Thread(
90
- target=wait_for_server_then_launch_browser, args=(port,), daemon=True
91
- )
92
- browser_thread.start()
93
75
  _run_flask_server(path, port)
76
+ import warnings
77
+
78
+ warnings.warn("Flask server has stopped")
94
79
  except KeyboardInterrupt:
95
80
  import _thread
96
81
 
@@ -113,19 +98,13 @@ def parse_args() -> argparse.Namespace:
113
98
  required=True,
114
99
  help="Port to run the server on (default: %(default)s)",
115
100
  )
116
- parser.add_argument(
117
- "--no-browser",
118
- action="store_true",
119
- help="Do not open the browser",
120
- )
121
101
  return parser.parse_args()
122
102
 
123
103
 
124
104
  def main() -> None:
125
105
  """Main function."""
126
106
  args = parse_args()
127
- open_browser = not args.no_browser
128
- run(args.fastled_js, args.port, open_browser)
107
+ run(args.fastled_js, args.port)
129
108
 
130
109
 
131
110
  if __name__ == "__main__":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastled
3
- Version: 1.2.20
3
+ Version: 1.2.21
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -20,6 +20,7 @@ Requires-Dist: appdirs>=1.4.4
20
20
  Requires-Dist: rapidfuzz>=3.10.1
21
21
  Requires-Dist: progress>=1.6
22
22
  Requires-Dist: Flask>=3.0.0
23
+ Requires-Dist: livereload
23
24
 
24
25
  # FastLED Wasm compiler
25
26
 
@@ -8,3 +8,4 @@ appdirs>=1.4.4
8
8
  rapidfuzz>=3.10.1
9
9
  progress>=1.6
10
10
  Flask>=3.0.0
11
+ 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