fastled 1.1.24__py2.py3-none-any.whl → 1.1.25__py2.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/__init__.py +1 -1
- fastled/client_server.py +9 -3
- fastled/select_sketch_directory.py +1 -1
- fastled/string_diff.py +15 -9
- {fastled-1.1.24.dist-info → fastled-1.1.25.dist-info}/METADATA +5 -2
- {fastled-1.1.24.dist-info → fastled-1.1.25.dist-info}/RECORD +10 -10
- {fastled-1.1.24.dist-info → fastled-1.1.25.dist-info}/LICENSE +0 -0
- {fastled-1.1.24.dist-info → fastled-1.1.25.dist-info}/WHEEL +0 -0
- {fastled-1.1.24.dist-info → fastled-1.1.25.dist-info}/entry_points.txt +0 -0
- {fastled-1.1.24.dist-info → fastled-1.1.25.dist-info}/top_level.txt +0 -0
fastled/__init__.py
CHANGED
fastled/client_server.py
CHANGED
@@ -269,13 +269,19 @@ def run_client_server(args: argparse.Namespace) -> int:
|
|
269
269
|
timeout=1.0
|
270
270
|
)
|
271
271
|
file_changes = source_code_watcher.get_all_changes()
|
272
|
+
sketch_files_changed = sketch_filewatcher.get_all_changes()
|
272
273
|
|
273
|
-
if
|
274
|
+
if file_changes:
|
275
|
+
print(
|
276
|
+
f"Changes detected in {file_changes}\nHit the space bar to trigger compile."
|
277
|
+
)
|
278
|
+
|
279
|
+
if space_bar_pressed or sketch_files_changed:
|
274
280
|
if space_bar_pressed:
|
275
281
|
print("Space bar pressed, triggering recompile...")
|
276
|
-
elif
|
282
|
+
elif sketch_files_changed:
|
277
283
|
print(
|
278
|
-
f"Changes detected in {','.join(
|
284
|
+
f"Changes detected in {','.join(sketch_files_changed)}, triggering recompile..."
|
279
285
|
)
|
280
286
|
last_compiled_result = compile_function(
|
281
287
|
last_hash_value=None
|
@@ -26,7 +26,7 @@ def select_sketch_directory(
|
|
26
26
|
return str(sketch_directories[index])
|
27
27
|
except (ValueError, IndexError):
|
28
28
|
inputs = [p for p in sketch_directories]
|
29
|
-
top_hits: list[tuple[
|
29
|
+
top_hits: list[tuple[float, Path]] = string_diff_paths(which, inputs)
|
30
30
|
if len(top_hits) == 1:
|
31
31
|
example = top_hits[0][1]
|
32
32
|
return str(example)
|
fastled/string_diff.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
from pathlib import Path
|
2
2
|
|
3
|
-
from rapidfuzz
|
3
|
+
from rapidfuzz import fuzz
|
4
4
|
|
5
5
|
|
6
6
|
# Returns the min distance strings. If there is a tie, it returns
|
@@ -8,29 +8,35 @@ from rapidfuzz.distance import Levenshtein
|
|
8
8
|
# Returns a tuple of index and string.
|
9
9
|
def string_diff(
|
10
10
|
input_string: str, string_list: list[str], ignore_case=True
|
11
|
-
) -> list[tuple[
|
11
|
+
) -> list[tuple[float, str]]:
|
12
12
|
|
13
13
|
def normalize(s: str) -> str:
|
14
14
|
return s.lower() if ignore_case else s
|
15
15
|
|
16
|
-
distances = [
|
17
|
-
|
18
|
-
|
16
|
+
# distances = [
|
17
|
+
# #Levenshtein.distance(normalize(input_string), normalize(s)) for s in string_list
|
18
|
+
# fuzz.partial_ratio(normalize(input_string), normalize(s)) for s in string_list
|
19
|
+
# ]
|
20
|
+
distances: list[float] = []
|
21
|
+
for s in string_list:
|
22
|
+
dist = fuzz.token_sort_ratio(normalize(input_string), normalize(s))
|
23
|
+
print("partial_ratio", dist)
|
24
|
+
distances.append(1.0 / (dist + 1.0))
|
19
25
|
min_distance = min(distances)
|
20
|
-
out: list[tuple[
|
26
|
+
out: list[tuple[float, str]] = []
|
21
27
|
for i, d in enumerate(distances):
|
22
28
|
if d == min_distance:
|
23
29
|
out.append((i, string_list[i]))
|
30
|
+
|
24
31
|
return out
|
25
32
|
|
26
33
|
|
27
34
|
def string_diff_paths(
|
28
35
|
input_string: str | Path, path_list: list[Path], ignore_case=True
|
29
|
-
) -> list[tuple[
|
36
|
+
) -> list[tuple[float, Path]]:
|
30
37
|
string_list = [str(p) for p in path_list]
|
31
38
|
tmp = string_diff(str(input_string), string_list, ignore_case)
|
32
|
-
|
33
|
-
out: list[tuple[int, Path]] = []
|
39
|
+
out: list[tuple[float, Path]] = []
|
34
40
|
for i, j in tmp:
|
35
41
|
p = Path(j)
|
36
42
|
out.append((i, p))
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: fastled
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.1.25
|
4
4
|
Summary: FastLED Wasm Compiler
|
5
5
|
Home-page: https://github.com/zackees/fastled-wasm
|
6
6
|
Maintainer: Zachary Vorhies
|
@@ -161,8 +161,11 @@ A: `delay()` will block `loop()` which blocks the main thread of the browser. Th
|
|
161
161
|
Q: How can I get the compiled size of my FastLED sketch smaller?
|
162
162
|
A: A big chunk of space is being used by unnecessary javascript `emscripten` is bundling. This can be tweeked by the wasm_compiler_settings.py file in the FastLED repo.
|
163
163
|
|
164
|
-
# Revisions
|
165
164
|
|
165
|
+
|
166
|
+
# Revisions
|
167
|
+
|
168
|
+
* 1.1.25 - Improved detecting which sketch directory the user means by fuzzy matching.
|
166
169
|
* 1.1.24 - Adds progress spinning bar for pulling images, which take a long time.
|
167
170
|
* 1.1.23 - Various fixes for MacOS
|
168
171
|
* 1.1.22 - Selecting sketch now allows strings and narrowing down paths if ambiguity
|
@@ -1,8 +1,8 @@
|
|
1
|
-
fastled/__init__.py,sha256=
|
1
|
+
fastled/__init__.py,sha256=e5n65cupSlM41aRjoBsTReaO1NiY5it6yu3XFaYSbBQ,64
|
2
2
|
fastled/app.py,sha256=VZP65zT1qLQLcOXA8oElPdZiladIAMvW9MVnqy5QTRM,6806
|
3
3
|
fastled/build_mode.py,sha256=joMwsV4K1y_LijT4gEAcjx69RZBoe_KmFmHZdPYbL_4,631
|
4
4
|
fastled/cli.py,sha256=CNR_pQR0sNVPNuv8e_nmm-0PI8sU-eUBUgnWgWkzW9c,237
|
5
|
-
fastled/client_server.py,sha256=
|
5
|
+
fastled/client_server.py,sha256=KdjgAiYJ2mKXIfYVFcVZtVDtbZhzkjqrzatAwNa_QWw,11437
|
6
6
|
fastled/compile_server.py,sha256=aBdpILSRrDsCJ5e9g5uwIqt9bcqE_8FrSddCV2ygtrI,5401
|
7
7
|
fastled/docker_manager.py,sha256=awQCAB0XfHMy6y1jfdEZx1qyzXTtYBmAwVyuQjxwuf0,20157
|
8
8
|
fastled/env.py,sha256=8wctQwl5qE4CI8NBugHtgMmUfEfHZ869JX5lGdSOJxc,304
|
@@ -10,17 +10,17 @@ fastled/filewatcher.py,sha256=5dVmjEG23kMeJa29tRVm5XKSr9sTD4ME2boo-CFDuUM,6910
|
|
10
10
|
fastled/keyboard.py,sha256=Zz_ggxOUTX2XQEy6K6kAoorVlUev4wEk9Awpvv9aStA,3241
|
11
11
|
fastled/open_browser.py,sha256=RRHcsZ5Vzsw1AuZUEYuSfjKmf_9j3NGMDUR-FndHmqs,1483
|
12
12
|
fastled/paths.py,sha256=VsPmgu0lNSCFOoEC0BsTYzDygXqy15AHUfN-tTuzDZA,99
|
13
|
-
fastled/select_sketch_directory.py,sha256=
|
13
|
+
fastled/select_sketch_directory.py,sha256=TZdCjl1D7YMKjodMTvDRurPcpAmN3x0TcJxffER2NfM,1314
|
14
14
|
fastled/sketch.py,sha256=5nRjg281lMH8Bo9wKjbcpTQCfEP574ZCG-lukvFmyQ8,2656
|
15
15
|
fastled/spinner.py,sha256=ZGFXona3SJxmuHIzMGa6tqB0IVDSRr8W_dju09Z1Hwg,901
|
16
|
-
fastled/string_diff.py,sha256=
|
16
|
+
fastled/string_diff.py,sha256=1AbgAxPFl7F_K4HunwQr0em8WZSvwxJ1MOOLA-ylFbM,1391
|
17
17
|
fastled/types.py,sha256=dDIsGHJkHNJ7B61wNp6X0JSLs_nrHiq7RlNqNWbwFec,194
|
18
18
|
fastled/util.py,sha256=t4M3NFMhnCzfYbLvIyJi0RdFssZqbTN_vVIaej1WV-U,265
|
19
19
|
fastled/web_compile.py,sha256=KuvKGdX6SSUUqC7YgX4T9SMSP5wdcPUhpg9-K9zPoTI,10378
|
20
20
|
fastled/assets/example.txt,sha256=lTBovRjiz0_TgtAtbA1C5hNi2ffbqnNPqkKg6UiKCT8,54
|
21
|
-
fastled-1.1.
|
22
|
-
fastled-1.1.
|
23
|
-
fastled-1.1.
|
24
|
-
fastled-1.1.
|
25
|
-
fastled-1.1.
|
26
|
-
fastled-1.1.
|
21
|
+
fastled-1.1.25.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
|
22
|
+
fastled-1.1.25.dist-info/METADATA,sha256=ZC9sOPn37oR4i96ddFOlgtiy_wfI2OOK7FXGruZif_I,14256
|
23
|
+
fastled-1.1.25.dist-info/WHEEL,sha256=0VNUDWQJzfRahYI3neAhz2UVbRCtztpN5dPHAGvmGXc,109
|
24
|
+
fastled-1.1.25.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
|
25
|
+
fastled-1.1.25.dist-info/top_level.txt,sha256=xfG6Z_ol9V5YmBROkZq2QTRwjbS2ouCUxaTJsOwfkOo,14
|
26
|
+
fastled-1.1.25.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|