fastled 1.3.2__py3-none-any.whl → 1.3.4__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/__version__.py CHANGED
@@ -1,4 +1,6 @@
1
1
  # IMPORTANT! There's a bug in github which will REJECT any version update
2
2
  # that has any other change in the repo. Please bump the version as the
3
3
  # ONLY change in a commit, or else the pypi update and the release will fail.
4
- __version__ = "1.3.2"
4
+ __version__ = "1.3.4"
5
+
6
+ __version_url_latest__ = "https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/src/fastled/__version__.py"
fastled/docker_manager.py CHANGED
@@ -366,7 +366,7 @@ class DockerManager:
366
366
  Returns:
367
367
  A tuple of (has_newer_version, message)
368
368
  has_newer_version: True if a newer version is available, False otherwise
369
- message: A message describing the result
369
+ message: A message describing the result, including the date of the newer version if available
370
370
  """
371
371
  try:
372
372
  # Get the local image
@@ -388,6 +388,24 @@ class DockerManager:
388
388
  if remote_image_hash_from_local_image == remote_image_hash:
389
389
  return False, f"Local image {image_name}:{tag} is up to date."
390
390
  else:
391
+ # Get the creation date of the remote image if possible
392
+ try:
393
+ # Try to get detailed image info including creation date
394
+ remote_image_details = self.client.api.inspect_image(
395
+ f"{image_name}:{tag}"
396
+ )
397
+ if "Created" in remote_image_details:
398
+ created_date = remote_image_details["Created"].split("T")[
399
+ 0
400
+ ] # Extract just the date part
401
+ return (
402
+ True,
403
+ f"Newer version of {image_name}:{tag} is available (published on {created_date}).",
404
+ )
405
+ except Exception:
406
+ pass
407
+
408
+ # Fallback if we couldn't get the date
391
409
  return True, f"Newer version of {image_name}:{tag} is available."
392
410
 
393
411
  except ImageNotFound:
fastled/print_filter.py CHANGED
@@ -94,8 +94,65 @@ class BuildArtifact:
94
94
  compile_or_link: CompileOrLink
95
95
  hash: int
96
96
 
97
+ def flags_pretty(self) -> str:
98
+ """
99
+ Returns the flags in a pretty format.
100
+ This is used for printing the flags to the console.
101
+ """
102
+ flags = self.build_flags
103
+ flags = flags.replace(" -I", "\n-I")
104
+ flags = flags.replace(" -D", "\n-D")
105
+ flags = flags.replace(" -l", "\n-l")
106
+ flags = flags.replace(" -L", "\n-L")
107
+ flags = flags.replace(" -o", "\n-o")
108
+ flags = flags.replace(" -W", "\n-W")
109
+ flags = flags.replace(" -f", "\n-f")
110
+ flags = flags.replace(" -g", "\n-g")
111
+
112
+ # break into lines and sort
113
+ lines = flags.splitlines()
114
+ first_line = lines[0]
115
+ lines.pop(0) # remove first line
116
+ lines = sorted(lines)
117
+ # remove duplicates
118
+ lines = list(dict.fromkeys(lines))
119
+ # remove empty lines
120
+ lines = [line for line in lines if line.strip() != ""]
121
+ # remove leading and trailing whitespace
122
+ lines = [line.strip() for line in lines]
123
+ lines = sorted(lines)
124
+ lines = [first_line] + lines # add first line back to the beginning
125
+ # stringify
126
+ flags = "\n".join(lines)
127
+ return flags
128
+
97
129
  def __str__(self) -> str:
98
- return f"{self.timestamp} {self.output_artifact} {self.build_flags} {self.compile_or_link} {self.hash}"
130
+ return f"{self.brief()} {self.build_flags} {self.compile_or_link} {self.hash}"
131
+
132
+ def brief(self) -> str:
133
+ return f"{self.timestamp:.2f} {self.output_artifact}"
134
+
135
+ def begin_flags(self) -> str:
136
+ """
137
+ Returns the flags that are used to begin a build.
138
+ This is the flags that are used for the first compile or link.
139
+ """
140
+
141
+ out: str = (
142
+ "\n################ NEW COMPILE/LINK FLAG GROUP #####################\n\n"
143
+ )
144
+ out += f"{self.flags_pretty()}\n"
145
+ return out
146
+
147
+ def end_flags(self) -> str:
148
+ """
149
+ Returns the flags that are used to end a build.
150
+ This is the flags that are used for the last compile or link.
151
+ """
152
+ out: str = (
153
+ "\n################ END COMPILE/LINK FLAG GROUP #####################\n"
154
+ )
155
+ return out
99
156
 
100
157
  @staticmethod
101
158
  def parse(input_str: str) -> "BuildArtifact | None":
fastled/server_flask.py CHANGED
@@ -148,7 +148,7 @@ def _run_flask_server(
148
148
  start_time = time.time()
149
149
  logger.info(f"Processing request: {request.method} {request.url}")
150
150
  # Forward the request to the compile server
151
- target_url = f"http://localhost:{compile_server_port}/{path}"
151
+ target_url = f"http://localhost:{compile_server_port}/dwarfsource/{path}"
152
152
  logger.info(f"Requesting: {target_url}")
153
153
  logger.info(f"Processing dwarfsource request for {path}")
154
154
 
@@ -317,6 +317,18 @@ def _run_flask_server(
317
317
  return Response(f"File not found: {path}", status=404)
318
318
  return Response(f"Error serving file: {str(e)}", status=500)
319
319
 
320
+ @app.route("/fastapi")
321
+ def server_backend_redirect():
322
+ """Redirect to the compile server"""
323
+ logger.info("Redirecting to compile server")
324
+ target_url = f"http://localhost:{compile_server_port}/docs"
325
+ logger.info(f"Redirecting to: {target_url}")
326
+ return Response(
327
+ f"Redirecting to compile server: <a href='{target_url}'>{target_url}</a>",
328
+ status=302,
329
+ headers={"Location": target_url},
330
+ )
331
+
320
332
  @app.route("/<path:path>")
321
333
  def serve_files(path: str):
322
334
  logger.info(f"Received request for path: {path}")
fastled/version.py ADDED
@@ -0,0 +1,41 @@
1
+ from concurrent.futures import Future, ThreadPoolExecutor
2
+
3
+ import httpx
4
+
5
+ from fastled.__version__ import __version_url_latest__
6
+
7
+
8
+ def _fetch_version() -> str | Exception:
9
+ """
10
+ Helper function to fetch the latest version from the GitHub repository.
11
+ """
12
+ try:
13
+ response = httpx.get(__version_url_latest__)
14
+ response.raise_for_status()
15
+ # Extract the version string from the response text
16
+ version_line = response.text.split("__version__ = ")[1].split('"')[1]
17
+ return version_line
18
+ except Exception as e:
19
+ return e
20
+
21
+
22
+ def get_latest_version() -> Future[str | Exception]:
23
+ """
24
+ Fetch the latest version from the GitHub repository.
25
+ Returns a future that will resolve with the version string or an exception.
26
+ """
27
+ executor = ThreadPoolExecutor()
28
+ return executor.submit(_fetch_version)
29
+
30
+
31
+ def unit_test() -> None:
32
+ future = get_latest_version()
33
+ latest_version = future.result() # Wait for the future to complete
34
+ if isinstance(latest_version, Exception):
35
+ print(f"Error fetching latest version: {latest_version}")
36
+ else:
37
+ print(f"Latest version: {latest_version}")
38
+
39
+
40
+ if __name__ == "__main__":
41
+ unit_test()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastled
3
- Version: 1.3.2
3
+ Version: 1.3.4
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -20,7 +20,7 @@ Requires-Dist: progress>=1.6
20
20
  Requires-Dist: watchfiles>=1.0.5
21
21
  Requires-Dist: Flask>=3.0.0
22
22
  Requires-Dist: livereload
23
- Requires-Dist: fastled-wasm-server>=1.0.23
23
+ Requires-Dist: fastled-wasm-server>=1.0.26
24
24
  Dynamic: home-page
25
25
  Dynamic: license-file
26
26
  Dynamic: maintainer
@@ -1,5 +1,5 @@
1
1
  fastled/__init__.py,sha256=YLikXGRWKlKAqj7bpvGmJLejGTFF-FC1lv2z1jwRinA,6852
2
- fastled/__version__.py,sha256=i5nt9_hrTiuTfrBnBa9PdAEziZPEnp21-3A8x0fqPiQ,246
2
+ fastled/__version__.py,sha256=4MX5PgJ2WDX2fCy1VZ3iXRS0xJJ1pzMuJ5tUBw_stv8,372
3
3
  fastled/app.py,sha256=1N5Q486YccaWCRqnaI2F04ktL64NAVjAN6i4c-zgm1o,5818
4
4
  fastled/cli.py,sha256=5EBsb02ueFUjlgrlg0GMdj3e5nnHVhvofmYyQRaw8uM,565
5
5
  fastled/cli_test.py,sha256=qJB9yLRFR3OwOwdIWSQ0fQsWLnA37v5pDccufiP_hTs,512
@@ -7,7 +7,7 @@ fastled/cli_test_interactive.py,sha256=BjNhveZOk5aCffHbcrxPQQjWmAuj4ClVKKcKX5eY6
7
7
  fastled/client_server.py,sha256=xNL5Fqyom2jlbn9vVNPkQ3NjrbpqXRiDk-p3M_U0odA,18903
8
8
  fastled/compile_server.py,sha256=rkXvrvdav5vDG8lv_OlBX3YSCHtnHMt25nXbfeg_r78,2960
9
9
  fastled/compile_server_impl.py,sha256=GOQ8AXN672HBBWM_lqUlNr5cDSIxnUDVkrQZheIO080,12531
10
- fastled/docker_manager.py,sha256=3Kc8ndnWRfX8_iqpmGTIFP_CBPwvtg37XQtVR6bJB1Q,38126
10
+ fastled/docker_manager.py,sha256=oDPyvbvWaC14-j6P7qFDVuavDpMneNuaN-hbz6e8IE8,39057
11
11
  fastled/filewatcher.py,sha256=3qS3L7zMQhFuVrkeGn1djsB_cB6x_E2YGJmmQWVAU_w,10033
12
12
  fastled/keyboard.py,sha256=UTAsqCn1UMYnB8YDzENiLTj4GeL45tYfEcO7_5fLFEg,3556
13
13
  fastled/keyz.py,sha256=LO-8m_7CpNDiZLM-FXhQ30f9gN1bUYz5lOsUPTIbI-c,4020
@@ -15,10 +15,10 @@ fastled/live_client.py,sha256=yoAul8tVgbbPf1oEC79SUZSHkLECxlrXxgWR9XaBIp4,2957
15
15
  fastled/open_browser.py,sha256=CJDX35YQOOTf--mFmGY9t8md_lxxBLkhuzL8Lj2WigQ,3846
16
16
  fastled/parse_args.py,sha256=tP8-AiVxEsZ5xvsL8YFfkd5L1whM3wzLS37IX2HCNrk,9454
17
17
  fastled/paths.py,sha256=VsPmgu0lNSCFOoEC0BsTYzDygXqy15AHUfN-tTuzDZA,99
18
- fastled/print_filter.py,sha256=k8Vfx8RN4UW4OtlMuw4i8TI85ee90vCryn8EO-5Urn8,5689
18
+ fastled/print_filter.py,sha256=H2jJPEKIoIQMjSP5vwKzYnNMtLPG2-cMESws4BXzfI4,7673
19
19
  fastled/project_init.py,sha256=OCIqpGmRMHNQtlXMTfX1x4Sou5WZgJtBNqPhnXbFFLI,4113
20
20
  fastled/select_sketch_directory.py,sha256=-eudwCns3AKj4HuHtSkZAFwbnf005SNL07pOzs9VxnE,1383
21
- fastled/server_flask.py,sha256=iS1r1_K6f8G5aybwt4VDmpmgo2_UMAHgTFEq1PH_3I0,17741
21
+ fastled/server_flask.py,sha256=HR7WNQWcxsOoKVvEc0Gs8YQQhEcwHZNwZ0gALuryioI,18271
22
22
  fastled/server_start.py,sha256=W9yKStkRlRNuXeV6j_6O7HjjFPyVLBHMcF9Uy2QjDWQ,479
23
23
  fastled/settings.py,sha256=dUVyJ8Mtprg0RwaS6oMWP8jBhr4C3R8fu4Hdx_Z1lCM,577
24
24
  fastled/sketch.py,sha256=Ftbh55Nt-p4hmPuPpj8Q9HrMzvnUazhoG_q9FHcxkns,3473
@@ -26,6 +26,7 @@ fastled/spinner.py,sha256=VHxmvB92P0Z_zYxRajb5HiNmkHHvZ5dG7hKtZltzpcs,867
26
26
  fastled/string_diff.py,sha256=wnXZed9EPhfL3FAcungd-VII_Ty3Im9OCa7GdKRRWBY,2578
27
27
  fastled/types.py,sha256=k1j1y5h1zpRonp1mqRXy797mSbLqzf5K1QEgl8f27jQ,4822
28
28
  fastled/util.py,sha256=hw3gxS1qGc5LL_QN88_VIjut6T0-61ImDQpxGp11DXY,1189
29
+ fastled/version.py,sha256=wWFgKsNXWthcE3YR6AYHNZlEW8VaMSX_CJ1Dl4SsQXc,1250
29
30
  fastled/web_compile.py,sha256=R159Od1VqeXTW6y3rQY0_P9f0CJYbPuBiMLqb-zBCUQ,11526
30
31
  fastled/assets/example.txt,sha256=lTBovRjiz0_TgtAtbA1C5hNi2ffbqnNPqkKg6UiKCT8,54
31
32
  fastled/assets/localhost-key.pem,sha256=Q-CNO_UoOd8fFNN4ljcnqwUeCMhzTplRjLO2x0pYRlU,1704
@@ -34,9 +35,9 @@ fastled/site/build.py,sha256=pjsaeHQQh_Zdh1g5Q78lYlUT7UPDFuNgW5YZkpsPxWc,14436
34
35
  fastled/site/examples.py,sha256=s6vj2zJc6BfKlnbwXr1QWY1mzuDBMt6j5MEBOWjO_U8,155
35
36
  fastled/test/can_run_local_docker_tests.py,sha256=LEuUbHctRhNNFWcvnz2kEGmjDJeXO4c3kNpizm3yVJs,400
36
37
  fastled/test/examples.py,sha256=GfaHeY1E8izBl6ZqDVjz--RHLyVR4NRnQ5pBesCFJFY,1673
37
- fastled-1.3.2.dist-info/licenses/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
38
- fastled-1.3.2.dist-info/METADATA,sha256=WsYRerfOCYnjPQFQD0L4xTp8ar8xjhBYAYOoXIt9KpU,30520
39
- fastled-1.3.2.dist-info/WHEEL,sha256=QZxptf4Y1BKFRCEDxD4h2V0mBFQOVFLFEpvxHmIs52A,91
40
- fastled-1.3.2.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
41
- fastled-1.3.2.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
42
- fastled-1.3.2.dist-info/RECORD,,
38
+ fastled-1.3.4.dist-info/licenses/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
39
+ fastled-1.3.4.dist-info/METADATA,sha256=LDccrxfGS6WFDfciWo5D9RV4NS56l6qx3UzvtVfmCQs,30520
40
+ fastled-1.3.4.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
41
+ fastled-1.3.4.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
42
+ fastled-1.3.4.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
43
+ fastled-1.3.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.6.0)
2
+ Generator: setuptools (80.7.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5