fastled 1.4.40__py3-none-any.whl → 1.4.42__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,6 +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.4.40"
4
+ __version__ = "1.4.42"
5
5
 
6
6
  __version_url_latest__ = "https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/src/fastled/__version__.py"
fastled/docker_manager.py CHANGED
@@ -26,7 +26,6 @@ from docker.models.images import Image
26
26
  from filelock import FileLock
27
27
 
28
28
  from fastled.print_filter import PrintFilter, PrintFilterDefault
29
- from fastled.spinner import Spinner
30
29
 
31
30
  CONFIG_DIR = Path(user_data_dir("fastled", "fastled"))
32
31
  CONFIG_DIR.mkdir(parents=True, exist_ok=True)
@@ -507,14 +506,9 @@ class DockerManager:
507
506
  return False
508
507
 
509
508
  # Quick check for latest version
510
- with Spinner(f"Pulling newer version of {image_name}:{tag}..."):
511
- cmd_list = ["docker", "pull", f"{image_name}:{tag}"]
512
- subprocess.run(
513
- cmd_list,
514
- check=True,
515
- stdout=subprocess.DEVNULL,
516
- stderr=subprocess.DEVNULL,
517
- )
509
+ print(f"Pulling newer version of {image_name}:{tag}...")
510
+ cmd_list = ["docker", "pull", f"{image_name}:{tag}"]
511
+ subprocess.run(cmd_list, check=True)
518
512
  print(f"Updated to newer version of {image_name}:{tag}")
519
513
  local_image_hash = self.client.images.get(f"{image_name}:{tag}").id
520
514
  assert local_image_hash is not None
@@ -524,15 +518,10 @@ class DockerManager:
524
518
 
525
519
  except ImageNotFound:
526
520
  print(f"Image {image_name}:{tag} not found.")
527
- with Spinner("Loading "):
528
- # We use docker cli here because it shows the download.
529
- cmd_list = ["docker", "pull", f"{image_name}:{tag}"]
530
- subprocess.run(
531
- cmd_list,
532
- check=True,
533
- stdout=subprocess.DEVNULL,
534
- stderr=subprocess.DEVNULL,
535
- )
521
+ print("Loading...")
522
+ # We use docker cli here because it shows the download.
523
+ cmd_list = ["docker", "pull", f"{image_name}:{tag}"]
524
+ subprocess.run(cmd_list, check=True)
536
525
  try:
537
526
  local_image = self.client.images.get(f"{image_name}:{tag}")
538
527
  local_image_hash = local_image.id
fastled/string_diff.py CHANGED
@@ -80,14 +80,100 @@ def string_diff(
80
80
  exact_matches = [s for s in string_list if s == input_string]
81
81
  substring_matches = [s for s in string_list if input_string in s]
82
82
 
83
- # If there's an exact match AND other substring matches, return all substring matches
84
- # This provides better user experience for partial matching
85
- if exact_matches and len(substring_matches) > 1:
86
- out: list[tuple[float, str]] = []
87
- for i, s in enumerate(substring_matches):
88
- s_mapped = map_string.get(s, s)
89
- out.append((i, s_mapped))
90
- return out
83
+ # If there's exactly one exact match, and there are substring matches,
84
+ # check if we should prioritize the exact match or return all variants
85
+ if len(exact_matches) == 1 and len(substring_matches) > 1:
86
+ exact_match = exact_matches[0]
87
+ other_substring_matches = [s for s in substring_matches if s != exact_match]
88
+
89
+ # Prioritize exact match only if it appears at the start of other matches
90
+ # AND those matches have a camelCase boundary (indicating compound words)
91
+ # We need to use the original (non-lowercased) strings for camelCase detection
92
+ should_prioritize_exact = True
93
+ original_exact_match = map_string[exact_match] # Get the original casing
94
+
95
+ for other_match in other_substring_matches:
96
+ original_other_match = map_string[other_match] # Get the original casing
97
+
98
+ if not original_other_match.lower().startswith(
99
+ original_exact_match.lower()
100
+ ):
101
+ # If the exact match isn't at the start, don't prioritize
102
+ should_prioritize_exact = False
103
+ break
104
+
105
+ # Check for camelCase boundary after the exact match in the ORIGINAL string
106
+ remainder = original_other_match[len(original_exact_match) :]
107
+ if remainder and remainder[0].isupper():
108
+ # Only prioritize exact match if the exact match is very short (4 chars or less)
109
+ # AND the remainder suggests a different concept
110
+ if len(original_exact_match) <= 4 and len(remainder) >= 6:
111
+ # This looks like a camelCase compound word (e.g., "wasm" -> "WasmScreenCoords")
112
+ continue
113
+ else:
114
+ # This looks like a variant (e.g., "Noise" -> "NoisePlayground", "Fire2012" -> "Fire2012WithPalette")
115
+ should_prioritize_exact = False
116
+ break
117
+ else:
118
+ # This looks like a variant/extension (e.g., "Blur" -> "Blur2d")
119
+ should_prioritize_exact = False
120
+ break
121
+
122
+ if should_prioritize_exact:
123
+ out: list[tuple[float, str]] = []
124
+ for i, s in enumerate(exact_matches):
125
+ s_mapped = map_string.get(s, s)
126
+ out.append((i, s_mapped))
127
+ return out
128
+ else:
129
+ # Apply character count filtering only for very specific compound terms
130
+ # Main criteria: contains numbers AND ends with numbers/letters (like Wave2d, Fire2012)
131
+ original_exact_match = map_string[exact_match]
132
+ should_apply_char_filter = (
133
+ len(original_exact_match) >= 5 # Longer terms
134
+ and any(c.isdigit() for c in original_exact_match) # Contains numbers
135
+ and (
136
+ original_exact_match[-1].isdigit()
137
+ or original_exact_match[-1].islower()
138
+ ) # Ends specifically (compound pattern)
139
+ )
140
+
141
+ if should_apply_char_filter:
142
+ # Filter substring matches based on extra character count
143
+ # Use a more lenient threshold for shorter base terms
144
+ if len(original_exact_match) <= 6:
145
+ # For short terms, allow more extra chars (e.g., "Wave2d" + "FxWave2d")
146
+ MAX_EXTRA_CHARS = min(10, len(original_exact_match) * 2)
147
+ else:
148
+ # For longer terms, allow significant extensions (e.g., "Fire2012" + "Fire2012WithPalette")
149
+ MAX_EXTRA_CHARS = 12
150
+
151
+ filtered_matches = []
152
+
153
+ for s in substring_matches:
154
+ original_s = map_string[s]
155
+ if s == exact_match:
156
+ # Always include the exact match
157
+ filtered_matches.append(s)
158
+ else:
159
+ # Calculate extra characters
160
+ extra_chars = len(original_s) - len(original_exact_match)
161
+ if extra_chars <= MAX_EXTRA_CHARS:
162
+ filtered_matches.append(s)
163
+
164
+ # Return filtered matches
165
+ out: list[tuple[float, str]] = []
166
+ for i, s in enumerate(filtered_matches):
167
+ s_mapped = map_string.get(s, s) or s
168
+ out.append((i, s_mapped))
169
+ return out
170
+ else:
171
+ # Return all substring matches (original behavior for base terms)
172
+ out: list[tuple[float, str]] = []
173
+ for i, s in enumerate(substring_matches):
174
+ s_mapped = map_string.get(s, s) or s
175
+ out.append((i, s_mapped))
176
+ return out
91
177
 
92
178
  # If there's only an exact match and no other substring matches, return just the exact match
93
179
  if exact_matches and len(substring_matches) == 1:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastled
3
- Version: 1.4.40
3
+ Version: 1.4.42
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -1,6 +1,6 @@
1
1
  fastled/__init__.py,sha256=LlLu9fO3O4FeB5-wt2wHGIFJW76H9FlhdABytEqg8A4,7717
2
2
  fastled/__main__.py,sha256=OcKv2ER1_iQAsZzLIUb3C8hRC9L2clNOhCrjpshrlf4,336
3
- fastled/__version__.py,sha256=0pXyPjHx0w-0o_I1bOwnCMF-7z8_EX6vs8nA9YwHlDg,373
3
+ fastled/__version__.py,sha256=h6_pqiRQu9IEYEfAK9ev6nZGN0bUwNh6Sdxqs4k-McQ,373
4
4
  fastled/app.py,sha256=fWOH2SA4rxW8BPNgBrKs4xsWvUEMX6RzMWPKyyjBoVM,7539
5
5
  fastled/args.py,sha256=Xa7AYnoMcsuSVQUyM6M2P_8liQtQFJzuuBdPbfw9U-g,4786
6
6
  fastled/cli.py,sha256=drgR2AOxVrj3QEz58iiKscYAumbbin2vIV-k91VCOAA,561
@@ -9,7 +9,7 @@ fastled/cli_test_interactive.py,sha256=BjNhveZOk5aCffHbcrxPQQjWmAuj4ClVKKcKX5eY6
9
9
  fastled/client_server.py,sha256=RnxVnQSFZ4B6xqDHkde6uu9bB6xpPsH5k39m77yrCZc,24730
10
10
  fastled/compile_server.py,sha256=MgKX4vnC-Zn_dj6svdoDmSP_3lLW_1QGpP3vooygjaQ,3421
11
11
  fastled/compile_server_impl.py,sha256=__Uiyys_8-LD8Lnev0BMUr6UpHd-2LaF--rTybxZPVE,13049
12
- fastled/docker_manager.py,sha256=_C-H3_gvT43TTT9yraCXBJmwweBmSe3o_YZOTI_7sfc,41205
12
+ fastled/docker_manager.py,sha256=mjlqVA4_kPPoCqP8DSeEN3hgRNdpId8gyV_sk2icVHE,40769
13
13
  fastled/emoji_util.py,sha256=z3lROwgfCxpqIIJFzQxehH8gcTwGdf4VLPsUgcbcFBM,849
14
14
  fastled/filewatcher.py,sha256=1EFeOLPEA_aN_V_tzgixS3mDhfleh0arTGUy0vWq6Is,10101
15
15
  fastled/find_good_connection.py,sha256=xnrJjrbwNZUkvSQRn_ZTMoVh5GBWTbO-lEsr_L95xq8,3372
@@ -29,7 +29,7 @@ fastled/server_start.py,sha256=W9yKStkRlRNuXeV6j_6O7HjjFPyVLBHMcF9Uy2QjDWQ,479
29
29
  fastled/settings.py,sha256=8RLN3S0ZK4DMphr0gKPfwPKfwIzOtHiQsqMTpGnX7Xg,1842
30
30
  fastled/sketch.py,sha256=Ftbh55Nt-p4hmPuPpj8Q9HrMzvnUazhoG_q9FHcxkns,3473
31
31
  fastled/spinner.py,sha256=VHxmvB92P0Z_zYxRajb5HiNmkHHvZ5dG7hKtZltzpcs,867
32
- fastled/string_diff.py,sha256=oTncu0qYdLlLUtYLLDB4bzdQ2OfzegAR6XNAzwE9fIs,6002
32
+ fastled/string_diff.py,sha256=C1b0DQp4GLV1Axj8t1InRWhjP0HHbvWHwf1yzrBKthA,10345
33
33
  fastled/types.py,sha256=tBikcoKjbBcCTi36MMCz_TjMEBoa-FppRL-yKAVwXFc,1909
34
34
  fastled/util.py,sha256=lJ6Pcqgn4DiNhvAqp6i8O0ghpvvE-JfA1XwvJ5qS9B0,2701
35
35
  fastled/version.py,sha256=TpBMiEVdO3_sUZEu6wmwN8Q4AgX2BiCxStCsnPKh6E0,1209
@@ -52,9 +52,9 @@ fastled/site/build.py,sha256=2YKU_UWKlJdGnjdbAbaL0co6kceFMSTVYwH1KCmgPZA,13987
52
52
  fastled/site/examples.py,sha256=s6vj2zJc6BfKlnbwXr1QWY1mzuDBMt6j5MEBOWjO_U8,155
53
53
  fastled/test/can_run_local_docker_tests.py,sha256=LEuUbHctRhNNFWcvnz2kEGmjDJeXO4c3kNpizm3yVJs,400
54
54
  fastled/test/examples.py,sha256=M0o-5NIhCuwcUHo7CPQw5llLd3OU3FfPgussVScd8Fs,1741
55
- fastled-1.4.40.dist-info/licenses/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
56
- fastled-1.4.40.dist-info/METADATA,sha256=IqWMpSs1ezW2_dvzV2HfqkDIe1vqtvTuDmSjcvrVCMk,31944
57
- fastled-1.4.40.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
58
- fastled-1.4.40.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
59
- fastled-1.4.40.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
60
- fastled-1.4.40.dist-info/RECORD,,
55
+ fastled-1.4.42.dist-info/licenses/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
56
+ fastled-1.4.42.dist-info/METADATA,sha256=RQkpIIf9yff394zIUUbByeGP7u5VFa0Om-i6L78WYQI,31944
57
+ fastled-1.4.42.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
58
+ fastled-1.4.42.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
59
+ fastled-1.4.42.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
60
+ fastled-1.4.42.dist-info/RECORD,,