fastled 1.2.74__tar.gz → 1.2.75__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 (130) hide show
  1. {fastled-1.2.74 → fastled-1.2.75}/PKG-INFO +1 -1
  2. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/__init__.py +1 -1
  3. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/docker_manager.py +6 -20
  4. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/parse_args.py +3 -2
  5. fastled-1.2.75/src/fastled/print_filter.py +47 -0
  6. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/select_sketch_directory.py +3 -1
  7. {fastled-1.2.74 → fastled-1.2.75}/src/fastled.egg-info/PKG-INFO +1 -1
  8. {fastled-1.2.74 → fastled-1.2.75}/src/fastled.egg-info/SOURCES.txt +2 -0
  9. fastled-1.2.75/tests/unit/test_print_filter.py +26 -0
  10. {fastled-1.2.74 → fastled-1.2.75}/.aiderignore +0 -0
  11. {fastled-1.2.74 → fastled-1.2.75}/.dockerignore +0 -0
  12. {fastled-1.2.74 → fastled-1.2.75}/.github/workflows/build_multi_docker_image.yml +0 -0
  13. {fastled-1.2.74 → fastled-1.2.75}/.github/workflows/build_webpage.yml +0 -0
  14. {fastled-1.2.74 → fastled-1.2.75}/.github/workflows/lint.yml +0 -0
  15. {fastled-1.2.74 → fastled-1.2.75}/.github/workflows/publish_release.yml +0 -0
  16. {fastled-1.2.74 → fastled-1.2.75}/.github/workflows/template_build_docker_image.yml +0 -0
  17. {fastled-1.2.74 → fastled-1.2.75}/.github/workflows/test_build_exe.yml +0 -0
  18. {fastled-1.2.74 → fastled-1.2.75}/.github/workflows/test_macos.yml +0 -0
  19. {fastled-1.2.74 → fastled-1.2.75}/.github/workflows/test_ubuntu.yml +0 -0
  20. {fastled-1.2.74 → fastled-1.2.75}/.github/workflows/test_win.yml +0 -0
  21. {fastled-1.2.74 → fastled-1.2.75}/.gitignore +0 -0
  22. {fastled-1.2.74 → fastled-1.2.75}/.pylintrc +0 -0
  23. {fastled-1.2.74 → fastled-1.2.75}/.vscode/launch.json +0 -0
  24. {fastled-1.2.74 → fastled-1.2.75}/.vscode/settings.json +0 -0
  25. {fastled-1.2.74 → fastled-1.2.75}/.vscode/tasks.json +0 -0
  26. {fastled-1.2.74 → fastled-1.2.75}/Dockerfile +0 -0
  27. {fastled-1.2.74 → fastled-1.2.75}/LICENSE +0 -0
  28. {fastled-1.2.74 → fastled-1.2.75}/MANIFEST.in +0 -0
  29. {fastled-1.2.74 → fastled-1.2.75}/README.md +0 -0
  30. {fastled-1.2.74 → fastled-1.2.75}/RELEASE.md +0 -0
  31. {fastled-1.2.74 → fastled-1.2.75}/TODO.md +0 -0
  32. {fastled-1.2.74 → fastled-1.2.75}/build_exe.py +0 -0
  33. {fastled-1.2.74 → fastled-1.2.75}/build_site.py +0 -0
  34. {fastled-1.2.74 → fastled-1.2.75}/clean +0 -0
  35. {fastled-1.2.74 → fastled-1.2.75}/compiler/CMakeLists.txt +0 -0
  36. {fastled-1.2.74 → fastled-1.2.75}/compiler/__init__.py +0 -0
  37. {fastled-1.2.74 → fastled-1.2.75}/compiler/arduino-pre-process.sh +0 -0
  38. {fastled-1.2.74 → fastled-1.2.75}/compiler/build.sh +0 -0
  39. {fastled-1.2.74 → fastled-1.2.75}/compiler/build_archive.sh +0 -0
  40. {fastled-1.2.74 → fastled-1.2.75}/compiler/build_fast.sh +0 -0
  41. {fastled-1.2.74 → fastled-1.2.75}/compiler/code_sync.py +0 -0
  42. {fastled-1.2.74 → fastled-1.2.75}/compiler/compile.py +0 -0
  43. {fastled-1.2.74 → fastled-1.2.75}/compiler/compile_lock.py +0 -0
  44. {fastled-1.2.74 → fastled-1.2.75}/compiler/entrypoint.sh +0 -0
  45. {fastled-1.2.74 → fastled-1.2.75}/compiler/extra/100dots.html +0 -0
  46. {fastled-1.2.74 → fastled-1.2.75}/compiler/extra/demo_threejs.html +0 -0
  47. {fastled-1.2.74 → fastled-1.2.75}/compiler/extra/micdemo.html +0 -0
  48. {fastled-1.2.74 → fastled-1.2.75}/compiler/extra/mp3upload.html +0 -0
  49. {fastled-1.2.74 → fastled-1.2.75}/compiler/extra/webgl_postprocessing_unreal_bloom.html +0 -0
  50. {fastled-1.2.74 → fastled-1.2.75}/compiler/final_prewarm.sh +0 -0
  51. {fastled-1.2.74 → fastled-1.2.75}/compiler/init_runtime.py +0 -0
  52. {fastled-1.2.74 → fastled-1.2.75}/compiler/install-arduino-cli.sh +0 -0
  53. {fastled-1.2.74 → fastled-1.2.75}/compiler/libcompile/CMakeLists.txt +0 -0
  54. {fastled-1.2.74 → fastled-1.2.75}/compiler/paths.py +0 -0
  55. {fastled-1.2.74 → fastled-1.2.75}/compiler/pre-process.sh +0 -0
  56. {fastled-1.2.74 → fastled-1.2.75}/compiler/prewarm.sh +0 -0
  57. {fastled-1.2.74 → fastled-1.2.75}/compiler/process-ino.py +0 -0
  58. {fastled-1.2.74 → fastled-1.2.75}/compiler/process_extended.py +0 -0
  59. {fastled-1.2.74 → fastled-1.2.75}/compiler/pyproject.toml +0 -0
  60. {fastled-1.2.74 → fastled-1.2.75}/compiler/run.py +0 -0
  61. {fastled-1.2.74 → fastled-1.2.75}/compiler/server.py +0 -0
  62. {fastled-1.2.74 → fastled-1.2.75}/compiler/sketch_hasher.py +0 -0
  63. {fastled-1.2.74 → fastled-1.2.75}/compiler/wasm_compiler_flags.py +0 -0
  64. {fastled-1.2.74 → fastled-1.2.75}/docker-compose.yml +0 -0
  65. {fastled-1.2.74 → fastled-1.2.75}/install +0 -0
  66. {fastled-1.2.74 → fastled-1.2.75}/install_linux.sh +0 -0
  67. {fastled-1.2.74 → fastled-1.2.75}/lint +0 -0
  68. {fastled-1.2.74 → fastled-1.2.75}/pyproject.toml +0 -0
  69. {fastled-1.2.74 → fastled-1.2.75}/requirements.testing.txt +0 -0
  70. {fastled-1.2.74 → fastled-1.2.75}/setup.cfg +0 -0
  71. {fastled-1.2.74 → fastled-1.2.75}/setup.py +0 -0
  72. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/app.py +0 -0
  73. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/assets/example.txt +0 -0
  74. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/assets/localhost-key.pem +0 -0
  75. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/assets/localhost.pem +0 -0
  76. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/cli.py +0 -0
  77. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/cli_test.py +0 -0
  78. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/client_server.py +0 -0
  79. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/compile_server.py +0 -0
  80. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/compile_server_impl.py +0 -0
  81. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/filewatcher.py +0 -0
  82. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/interactive_srcs.py +0 -0
  83. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/keyboard.py +0 -0
  84. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/keyz.py +0 -0
  85. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/live_client.py +0 -0
  86. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/open_browser.py +0 -0
  87. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/paths.py +0 -0
  88. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/project_init.py +0 -0
  89. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/server_fastapi.py +0 -0
  90. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/server_fastapi_cli.py +0 -0
  91. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/server_flask.py +0 -0
  92. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/server_start.py +0 -0
  93. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/settings.py +0 -0
  94. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/site/build.py +0 -0
  95. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/site/examples.py +0 -0
  96. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/sketch.py +0 -0
  97. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/spinner.py +0 -0
  98. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/string_diff.py +0 -0
  99. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/test/can_run_local_docker_tests.py +0 -0
  100. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/test/examples.py +0 -0
  101. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/types.py +0 -0
  102. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/util.py +0 -0
  103. {fastled-1.2.74 → fastled-1.2.75}/src/fastled/web_compile.py +0 -0
  104. {fastled-1.2.74 → fastled-1.2.75}/src/fastled.egg-info/dependency_links.txt +0 -0
  105. {fastled-1.2.74 → fastled-1.2.75}/src/fastled.egg-info/entry_points.txt +0 -0
  106. {fastled-1.2.74 → fastled-1.2.75}/src/fastled.egg-info/requires.txt +0 -0
  107. {fastled-1.2.74 → fastled-1.2.75}/src/fastled.egg-info/top_level.txt +0 -0
  108. {fastled-1.2.74 → fastled-1.2.75}/test +0 -0
  109. {fastled-1.2.74 → fastled-1.2.75}/tests/integration/test_build_examples.py +0 -0
  110. {fastled-1.2.74 → fastled-1.2.75}/tests/integration/test_examples.py +0 -0
  111. {fastled-1.2.74 → fastled-1.2.75}/tests/unit/html/index.html +0 -0
  112. {fastled-1.2.74 → fastled-1.2.75}/tests/unit/test_api.py +0 -0
  113. {fastled-1.2.74 → fastled-1.2.75}/tests/unit/test_bad_ino.py +0 -0
  114. {fastled-1.2.74 → fastled-1.2.75}/tests/unit/test_cli.py +0 -0
  115. {fastled-1.2.74 → fastled-1.2.75}/tests/unit/test_compile_server.py +0 -0
  116. {fastled-1.2.74 → fastled-1.2.75}/tests/unit/test_docker_linux_on_windows.py +0 -0
  117. {fastled-1.2.74 → fastled-1.2.75}/tests/unit/test_embedded_data.py +0 -0
  118. {fastled-1.2.74 → fastled-1.2.75}/tests/unit/test_filechanger.py +0 -0
  119. {fastled-1.2.74 → fastled-1.2.75}/tests/unit/test_http_server.py +0 -0
  120. {fastled-1.2.74 → fastled-1.2.75}/tests/unit/test_ino/bad/bad.ino +0 -0
  121. {fastled-1.2.74 → fastled-1.2.75}/tests/unit/test_ino/bad_platformio/bad_platformio.ino +0 -0
  122. {fastled-1.2.74 → fastled-1.2.75}/tests/unit/test_ino/bad_platformio/platformio.ini +0 -0
  123. {fastled-1.2.74 → fastled-1.2.75}/tests/unit/test_ino/embedded/data/bigdata.dat +0 -0
  124. {fastled-1.2.74 → fastled-1.2.75}/tests/unit/test_ino/embedded/wasm.ino +0 -0
  125. {fastled-1.2.74 → fastled-1.2.75}/tests/unit/test_ino/wasm/wasm.ino +0 -0
  126. {fastled-1.2.74 → fastled-1.2.75}/tests/unit/test_project_init.py +0 -0
  127. {fastled-1.2.74 → fastled-1.2.75}/tests/unit/test_server_and_client_seperatly.py +0 -0
  128. {fastled-1.2.74 → fastled-1.2.75}/tests/unit/test_string_diff.py +0 -0
  129. {fastled-1.2.74 → fastled-1.2.75}/tests/unit/test_webcompile.py +0 -0
  130. {fastled-1.2.74 → fastled-1.2.75}/upload_package.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastled
3
- Version: 1.2.74
3
+ Version: 1.2.75
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -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.74"
16
+ __version__ = "1.2.75"
17
17
 
18
18
  DOCKER_FILE = (
19
19
  "https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/Dockerfile"
@@ -25,6 +25,7 @@ from docker.models.containers import Container
25
25
  from docker.models.images import Image
26
26
  from filelock import FileLock
27
27
 
28
+ from fastled.print_filter import PrintFilter
28
29
  from fastled.spinner import Spinner
29
30
 
30
31
  CONFIG_DIR = Path(user_data_dir("fastled", "fastled"))
@@ -99,25 +100,10 @@ class Volume:
99
100
  return volumes
100
101
 
101
102
 
102
- class PrintFilter:
103
- """Provides filtering for text output so that source files match up with local names."""
104
-
105
- def __init__(self) -> None:
106
- pass
107
-
108
- def _remove_ino_cpp(self, text: str) -> str:
109
- return text.replace(".ino.cpp", ".ino")
110
-
111
- def _filter_all(self, text: str) -> str:
112
- text = self._remove_ino_cpp(text)
113
- return text
114
-
115
- def print(self, text: str | bytes) -> None:
116
- """Prints the text to the console."""
117
- if isinstance(text, bytes):
118
- text = text.decode("utf-8")
119
- text = self._filter_all(text)
120
- print(text, end="")
103
+ # Override the default PrintFilter to use a custom one.
104
+ def make_default_print_filter() -> PrintFilter:
105
+ """Create a default PrintFilter instance."""
106
+ return PrintFilter()
121
107
 
122
108
 
123
109
  class RunningContainer:
@@ -127,7 +113,7 @@ class RunningContainer:
127
113
  first_run: bool = False,
128
114
  filter: PrintFilter | None = None,
129
115
  ) -> None:
130
- self.filter = filter or PrintFilter()
116
+ self.filter = filter or make_default_print_filter()
131
117
  self.container = container
132
118
  self.first_run = first_run
133
119
  self.running = True
@@ -66,7 +66,7 @@ def parse_args() -> Args:
66
66
  parser.add_argument(
67
67
  "--profile",
68
68
  action="store_true",
69
- help="Enable profiling for web compilation",
69
+ help="Enable profiling of the C++ build system used for wasm compilation.",
70
70
  )
71
71
  parser.add_argument(
72
72
  "--force-compile",
@@ -79,6 +79,7 @@ def parse_args() -> Args:
79
79
  help="Disable automatic updates of the wasm compiler image when using docker.",
80
80
  )
81
81
  parser.add_argument(
82
+ "-u",
82
83
  "--update",
83
84
  "--upgrade",
84
85
  action="store_true",
@@ -89,7 +90,7 @@ def parse_args() -> Args:
89
90
  "--local",
90
91
  "-l",
91
92
  action="store_true",
92
- help="Use localhost for web compilation from an instance of fastled --server, creating it if necessary",
93
+ help="(Default): Use localhost for web compilation from an instance of fastled --server, creating it if necessary",
93
94
  )
94
95
  parser.add_argument(
95
96
  "--build",
@@ -0,0 +1,47 @@
1
+ import re
2
+
3
+
4
+ def _handle_ino_cpp(line: str) -> str:
5
+ if ".ino.cpp" in line[0:30]:
6
+ # Extract the filename without path and extension
7
+ match = re.search(r"src/([^/]+)\.ino\.cpp", line)
8
+ if match:
9
+ filename = match.group(1)
10
+ # Replace with examples/Filename/Filename.ino format
11
+ line = line.replace(
12
+ f"src/{filename}.ino.cpp", f"examples/{filename}/{filename}.ino"
13
+ )
14
+ else:
15
+ # Fall back to simple extension replacement if regex doesn't match
16
+ line = line.replace(".ino.cpp", ".ino")
17
+ return line
18
+
19
+
20
+ class PrintFilter:
21
+ """Provides filtering for text output so that source files match up with local names."""
22
+
23
+ def __init__(self, echo: bool = True) -> None:
24
+ self.echo = echo
25
+ self.build_started = False
26
+ pass
27
+
28
+ def _filter_all(self, text: str) -> str:
29
+ lines = text.splitlines()
30
+ out: list[str] = []
31
+ for line in lines:
32
+ if "# WASM is building" in line:
33
+ self.build_started = True
34
+ if self.build_started:
35
+ line = _handle_ino_cpp(line)
36
+ out.append(line)
37
+ text = "\n".join(out)
38
+ return text
39
+
40
+ def print(self, text: str | bytes) -> str:
41
+ """Prints the text to the console."""
42
+ if isinstance(text, bytes):
43
+ text = text.decode("utf-8")
44
+ text = self._filter_all(text)
45
+ if self.echo:
46
+ print(text, end="")
47
+ return text
@@ -20,7 +20,9 @@ def select_sketch_directory(
20
20
  print("\nMultiple Directories found, choose one:")
21
21
  for i, sketch_dir in enumerate(sketch_directories):
22
22
  print(f" [{i+1}]: {sketch_dir}")
23
- which = input("\nPlease specify a sketch directory: ").strip()
23
+ which = input(
24
+ "\nPlease specify a sketch directory\nYou can enter a number or type a fuzzy search: "
25
+ ).strip()
24
26
  try:
25
27
  index = int(which) - 1
26
28
  return str(sketch_directories[index])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastled
3
- Version: 1.2.74
3
+ Version: 1.2.75
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -77,6 +77,7 @@ src/fastled/live_client.py
77
77
  src/fastled/open_browser.py
78
78
  src/fastled/parse_args.py
79
79
  src/fastled/paths.py
80
+ src/fastled/print_filter.py
80
81
  src/fastled/project_init.py
81
82
  src/fastled/select_sketch_directory.py
82
83
  src/fastled/server_fastapi.py
@@ -113,6 +114,7 @@ tests/unit/test_docker_linux_on_windows.py
113
114
  tests/unit/test_embedded_data.py
114
115
  tests/unit/test_filechanger.py
115
116
  tests/unit/test_http_server.py
117
+ tests/unit/test_print_filter.py
116
118
  tests/unit/test_project_init.py
117
119
  tests/unit/test_server_and_client_seperatly.py
118
120
  tests/unit/test_string_diff.py
@@ -0,0 +1,26 @@
1
+ """
2
+ Unit test file.
3
+ """
4
+
5
+ import unittest
6
+
7
+ from fastled.print_filter import PrintFilter
8
+
9
+
10
+ class PrintFitlerTester(unittest.TestCase):
11
+ """Main tester class."""
12
+
13
+ def test_live_client(self) -> None:
14
+ """Tests that a project can be filtered"""
15
+ # Test the PrintFilter class
16
+ pf = PrintFilter(echo=False)
17
+ pf.print("# WASM is building") # This should trigger the filter.
18
+ result = pf.print("src/XYPath.ino.cpp") # This should now be transformed.
19
+ self.assertNotIn(".ino.cpp", result, "Expected .ino.cpp to be filtered out")
20
+ self.assertIn(
21
+ "examples/XYPath/XYPath.ino", result, "Expected path to be transformed"
22
+ )
23
+
24
+
25
+ if __name__ == "__main__":
26
+ unittest.main()
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
File without changes