fastled 1.3.17__tar.gz → 1.3.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.
- {fastled-1.3.17 → fastled-1.3.21}/Dockerfile +6 -8
- {fastled-1.3.17 → fastled-1.3.21}/PKG-INFO +1 -1
- {fastled-1.3.17 → fastled-1.3.21}/install +3 -4
- fastled-1.3.21/requirements.docker.txt +1 -0
- {fastled-1.3.17 → fastled-1.3.21}/requirements.testing.txt +0 -1
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/__version__.py +1 -1
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/server_flask.py +29 -76
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/util.py +2 -1
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/web_compile.py +1 -1
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled.egg-info/PKG-INFO +1 -1
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled.egg-info/SOURCES.txt +1 -0
- {fastled-1.3.17 → fastled-1.3.21}/tests/unit/test_banner_string.py +2 -2
- {fastled-1.3.17 → fastled-1.3.21}/tests/unit/test_debug_fetch_source_files.py +30 -17
- {fastled-1.3.17 → fastled-1.3.21}/tests/unit/test_http_server.py +3 -0
- {fastled-1.3.17 → fastled-1.3.21}/tests/unit/test_ino/bad_platformio/platformio.ini +1 -1
- {fastled-1.3.17 → fastled-1.3.21}/.aiderignore +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/.dockerignore +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/.github/workflows/build_multi_docker_image.yml +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/.github/workflows/build_webpage.yml +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/.github/workflows/lint.yml +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/.github/workflows/publish_release.yml +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/.github/workflows/template_build_docker_image.yml +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/.github/workflows/test_build_exe.yml +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/.github/workflows/test_macos.yml +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/.github/workflows/test_ubuntu.yml +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/.github/workflows/test_win.yml +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/.gitignore +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/.pylintrc +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/.vscode/launch.json +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/.vscode/settings.json +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/.vscode/tasks.json +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/DEBUGGER.md +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/FAQ.md +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/LICENSE +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/MANIFEST.in +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/README.md +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/RELEASE.md +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/TODO.md +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/build_exe.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/build_local_docker.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/build_site.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/clean +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/compiler/debug.sh +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/compiler/run.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/demo/100dots.html +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/demo/demo_threejs.html +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/demo/micdemo.html +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/demo/mp3upload.html +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/demo/webgl_postprocessing_unreal_bloom.html +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/docker-compose.yml +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/entrypoint.sh +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/install_linux.sh +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/lint +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/pyproject.toml +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/setup.cfg +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/setup.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/__init__.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/app.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/args.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/assets/example.txt +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/assets/localhost-key.pem +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/assets/localhost.pem +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/cli.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/cli_test.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/cli_test_interactive.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/client_server.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/compile_server.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/compile_server_impl.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/docker_manager.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/filewatcher.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/keyboard.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/keyz.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/live_client.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/open_browser.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/parse_args.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/paths.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/print_filter.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/project_init.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/select_sketch_directory.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/server_start.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/settings.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/site/build.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/site/examples.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/sketch.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/spinner.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/string_diff.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/test/can_run_local_docker_tests.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/test/examples.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/types.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled/version.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled.egg-info/dependency_links.txt +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled.egg-info/entry_points.txt +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled.egg-info/requires.txt +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/src/fastled.egg-info/top_level.txt +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/test +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/tests/integration/test_build_examples.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/tests/integration/test_examples.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/tests/unit/html/index.html +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/tests/unit/test_api.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/tests/unit/test_bad_ino.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/tests/unit/test_cli.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/tests/unit/test_compile_server.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/tests/unit/test_docker_linux_on_windows.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/tests/unit/test_embedded_data.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/tests/unit/test_filechanger.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/tests/unit/test_ino/bad/bad.ino +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/tests/unit/test_ino/bad_platformio/bad_platformio.ino +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/tests/unit/test_ino/embedded/data/bigdata.dat +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/tests/unit/test_ino/embedded/wasm.ino +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/tests/unit/test_ino/wasm/wasm.ino +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/tests/unit/test_project_init.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/tests/unit/test_server_and_client_seperatly.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/tests/unit/test_string_diff.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/tests/unit/test_version.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/tests/unit/test_webcompile.py +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/upload_package.sh +0 -0
- {fastled-1.3.17 → fastled-1.3.21}/vscode-plugin/readme +0 -0
@@ -3,14 +3,12 @@
|
|
3
3
|
FROM niteris/fastled-wasm-compiler:latest
|
4
4
|
|
5
5
|
|
6
|
-
COPY requirements.
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
uv pip install --system -r /install/requirements.txt --refresh
|
12
|
-
uv pip install --system -r /install/requirements.txt --refresh || \
|
13
|
-
uv pip install --system -r /install/requirements.txt --refresh
|
6
|
+
COPY requirements.docker.txt /install/requirements.docker.txt
|
7
|
+
|
8
|
+
# Fresh packages need multiple hits to bust through stale cache... and this is fast.
|
9
|
+
RUN uv pip install --system -r /install/requirements.docker.txt --refresh || \
|
10
|
+
uv pip install --system -r /install/requirements.docker.txt --refresh || \
|
11
|
+
uv pip install --system -r /install/requirements.docker.txt --refresh
|
14
12
|
|
15
13
|
# FIRST PRE-WARM CYCLE and initial setup: Download the fastled repo from the github and pre-warm the cache with a compilation.
|
16
14
|
# This is by far the most expensive part of the build, because platformio needs to download initial tools. This
|
@@ -19,10 +19,9 @@ fi
|
|
19
19
|
uv venv --python 3.11 --seed
|
20
20
|
uv run pip install -e .
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
fi
|
22
|
+
uv run pip install -r requirements.testing.txt
|
23
|
+
uv run pip install -r requirements.docker.txt
|
24
|
+
|
26
25
|
|
27
26
|
# If activate exists, delete it
|
28
27
|
if [[ -f activate ]]; then
|
@@ -0,0 +1 @@
|
|
1
|
+
fastled-wasm-server>=1.0.74
|
@@ -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.3.
|
4
|
+
__version__ = "1.3.21"
|
5
5
|
|
6
6
|
__version_url_latest__ = "https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/src/fastled/__version__.py"
|
@@ -28,13 +28,19 @@ else:
|
|
28
28
|
|
29
29
|
def _is_dwarf_source(path: str) -> bool:
|
30
30
|
"""Check if the path is a dwarf source file."""
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
31
|
+
logger.debug(f"_is_dwarf_source called with path: {path}")
|
32
|
+
if "dwarfsource" in path:
|
33
|
+
logger.debug(f"Path '{path}' contains 'dwarfsource'")
|
34
|
+
return True
|
35
|
+
_is_dwarf_source = False
|
36
|
+
for p in ["fastledsource", "sketchsource", "dwarfsource", "drawfsource"]:
|
37
|
+
if p in path:
|
38
|
+
_is_dwarf_source = True
|
39
|
+
logger.debug(f"Path '{p}' contains '{path}'")
|
40
|
+
break
|
41
|
+
if not _is_dwarf_source:
|
42
|
+
logger.debug(f"Path '{path}' is not a dwarf source file")
|
43
|
+
return _is_dwarf_source
|
38
44
|
|
39
45
|
|
40
46
|
def _run_flask_server(
|
@@ -136,70 +142,15 @@ def _run_flask_server(
|
|
136
142
|
logger.error(f"Error forwarding request: {e}", exc_info=True)
|
137
143
|
return Response(f"Error: {str(e)}", status=500)
|
138
144
|
|
139
|
-
def
|
140
|
-
"""Handle requests to
|
141
|
-
/fastledsource/js/fastledsource/git/fastled/src/
|
142
|
-
or
|
143
|
-
/sketchsource/js/src/Blink.ino
|
144
|
-
|
145
|
-
The names are a bit mangled due to the way C++ prefixing works near the root directory.
|
146
|
-
"""
|
147
|
-
from flask import request
|
148
|
-
|
149
|
-
start_time = time.time()
|
150
|
-
logger.info(f"Processing request: {request.method} {request.url}")
|
151
|
-
# Forward the request to the compile server
|
152
|
-
target_url = f"http://localhost:{compile_server_port}/dwarfsource/{path}"
|
153
|
-
logger.info(f"Requesting: {target_url}")
|
154
|
-
logger.info(f"Processing dwarfsource request for {path}")
|
155
|
-
|
156
|
-
# Log request headers
|
157
|
-
request_headers = {
|
158
|
-
key: value for key, value in request.headers if key != "Host"
|
159
|
-
}
|
160
|
-
logger.debug(f"Request headers: {request_headers}")
|
161
|
-
|
162
|
-
try:
|
163
|
-
# Forward the request with the same method, headers, and body
|
164
|
-
with httpx.Client() as client:
|
165
|
-
resp = client.request(
|
166
|
-
method=request.method,
|
167
|
-
url=target_url,
|
168
|
-
headers=request_headers,
|
169
|
-
content=request.get_data(),
|
170
|
-
cookies=request.cookies,
|
171
|
-
follow_redirects=True,
|
172
|
-
)
|
173
|
-
|
174
|
-
logger.info(f"Response status: {resp.status_code}")
|
175
|
-
logger.debug(f"Response headers: {dict(resp.headers)}")
|
176
|
-
|
177
|
-
# Create a Flask Response object from the httpx response
|
178
|
-
payload = resp.content
|
179
|
-
assert isinstance(payload, bytes)
|
180
|
-
|
181
|
-
# Check if the payload is empty
|
182
|
-
if len(payload) == 0:
|
183
|
-
logger.error("Empty payload received from compile server")
|
184
|
-
return Response("Empty payload", status=400)
|
185
|
-
|
186
|
-
response = Response(
|
187
|
-
payload, status=resp.status_code, headers=dict(resp.headers)
|
188
|
-
)
|
189
|
-
|
190
|
-
elapsed_time = time.time() - start_time
|
191
|
-
logger.info(f"Request completed in {elapsed_time:.3f} seconds")
|
192
|
-
|
193
|
-
return response
|
194
|
-
|
195
|
-
except Exception as e:
|
196
|
-
logger.error(f"Error handling dwarfsource request: {e}", exc_info=True)
|
197
|
-
return Response(f"Error: {str(e)}", status=500)
|
198
|
-
|
199
|
-
def handle_sourcefile(path: str) -> Response:
|
145
|
+
def handle_dwarfsource(path: str) -> Response:
|
200
146
|
"""Handle requests to /sourcefiles/*"""
|
201
147
|
from flask import Response, request
|
202
148
|
|
149
|
+
# Request body should be
|
150
|
+
# {
|
151
|
+
# "path": "string"
|
152
|
+
# }
|
153
|
+
|
203
154
|
start_time = time.time()
|
204
155
|
logger.info("\n##################################")
|
205
156
|
logger.info(f"# Serving source file /sourcefiles/ {path}")
|
@@ -208,7 +159,7 @@ def _run_flask_server(
|
|
208
159
|
logger.info(f"Processing sourcefile request for {path}")
|
209
160
|
|
210
161
|
# Forward the request to the compile server
|
211
|
-
target_url = f"http://localhost:{compile_server_port}/
|
162
|
+
target_url = f"http://localhost:{compile_server_port}/dwarfsource"
|
212
163
|
logger.info(f"Forwarding to: {target_url}")
|
213
164
|
|
214
165
|
# Log request headers
|
@@ -217,14 +168,18 @@ def _run_flask_server(
|
|
217
168
|
}
|
218
169
|
logger.debug(f"Request headers: {request_headers}")
|
219
170
|
|
171
|
+
body: dict[str, str] = {
|
172
|
+
"path": path,
|
173
|
+
}
|
174
|
+
|
220
175
|
try:
|
221
176
|
# Forward the request with the same method, headers, and body
|
222
177
|
with httpx.Client() as client:
|
223
178
|
resp = client.request(
|
224
|
-
method=
|
179
|
+
method="POST",
|
225
180
|
url=target_url,
|
226
181
|
headers=request_headers,
|
227
|
-
|
182
|
+
json=body,
|
228
183
|
cookies=request.cookies,
|
229
184
|
follow_redirects=True,
|
230
185
|
)
|
@@ -336,12 +291,10 @@ def _run_flask_server(
|
|
336
291
|
|
337
292
|
try:
|
338
293
|
is_debug_src_code_request = _is_dwarf_source(path)
|
294
|
+
logger.info(f"is debug_src_code_request: {is_debug_src_code_request}")
|
339
295
|
if is_debug_src_code_request:
|
340
|
-
logger.info(f"Handling as
|
341
|
-
return
|
342
|
-
elif path.startswith("sourcefiles/"):
|
343
|
-
logger.info(f"Handling as sourcefiles: {path}")
|
344
|
-
return handle_sourcefile(path)
|
296
|
+
logger.info(f"Handling as dwarf source file request: {path}")
|
297
|
+
return handle_dwarfsource(path)
|
345
298
|
else:
|
346
299
|
logger.info(f"Handling as local file: {path}")
|
347
300
|
return handle_local_file_fetch(path)
|
@@ -19,7 +19,8 @@ def banner_string(msg: str) -> str:
|
|
19
19
|
for line in lines:
|
20
20
|
out.append(f"# {line} " + " " * (max_length - len(line)) + "#")
|
21
21
|
out.append(border)
|
22
|
-
|
22
|
+
outstr = "\n".join(out)
|
23
|
+
return f"\n{outstr}\n"
|
23
24
|
|
24
25
|
|
25
26
|
def print_banner(msg: str) -> None:
|
@@ -5,10 +5,10 @@ from fastled.util import banner_string
|
|
5
5
|
_MSG = "Hello, World!\nsecond line"
|
6
6
|
|
7
7
|
_EXPECTED: str = (
|
8
|
-
"#################\n"
|
8
|
+
"\n#################\n"
|
9
9
|
"# Hello, World! #\n"
|
10
10
|
"# second line #\n"
|
11
|
-
"
|
11
|
+
"#################\n"
|
12
12
|
)
|
13
13
|
|
14
14
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import os
|
2
|
-
|
3
|
-
os.environ["FLASK_SERVER_LOGGING"] = "1"
|
4
|
-
|
5
2
|
import time
|
6
3
|
import unittest
|
7
4
|
import warnings
|
8
5
|
from pathlib import Path
|
6
|
+
from urllib.parse import urlparse
|
9
7
|
|
10
8
|
import httpx
|
11
9
|
|
10
|
+
os.environ["FLASK_SERVER_LOGGING"] = "1"
|
11
|
+
|
12
12
|
from fastled import Api, LiveClient
|
13
13
|
|
14
14
|
HERE = Path(__file__).parent
|
@@ -18,10 +18,13 @@ TEST_INO_WASM = HERE / "test_ino" / "wasm"
|
|
18
18
|
_ENABLED = True
|
19
19
|
|
20
20
|
_DWARF_SRC_EXAMPLE1 = "http://localhost:{http_port}/dwarfsource/fastledsource/js/src/fastledsource/git/fastled/src/FastLED.h"
|
21
|
-
|
21
|
+
_DWARF_SRC_EXAMPLE2 = (
|
22
|
+
"http://localhost:{http_port}/dwarfsource/js/dwarfsource/git/fastled/src/chipsets.h"
|
23
|
+
)
|
22
24
|
|
23
25
|
_DWARF_SRC_EXAMPLES = [
|
24
|
-
_DWARF_SRC_EXAMPLE1,
|
26
|
+
# _DWARF_SRC_EXAMPLE1,
|
27
|
+
_DWARF_SRC_EXAMPLE2
|
25
28
|
]
|
26
29
|
|
27
30
|
|
@@ -84,13 +87,15 @@ class FetchSourceFileTester(unittest.TestCase):
|
|
84
87
|
if content_length == 0:
|
85
88
|
raise Exception("Content-Length is 0")
|
86
89
|
|
87
|
-
backend_url =
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
90
|
+
backend_url = backend_host + "/dwarfsource"
|
91
|
+
|
92
|
+
body: dict[str, str] = {
|
93
|
+
"path": "fastledsource/git/fastled/src/FastLED.h",
|
94
|
+
}
|
95
|
+
|
96
|
+
resp = httpx.post(
|
93
97
|
backend_url,
|
98
|
+
json=body,
|
94
99
|
timeout=100,
|
95
100
|
)
|
96
101
|
if resp.status_code != 200:
|
@@ -108,11 +113,19 @@ class FetchSourceFileTester(unittest.TestCase):
|
|
108
113
|
self.assertTrue(resp.status_code == 200, resp.status_code)
|
109
114
|
content_length = int(resp.headers["Content-Length"])
|
110
115
|
self.assertTrue(content_length > 0, "Content-Length is 0")
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
116
|
+
|
117
|
+
parsed_url = urlparse(url)
|
118
|
+
# Extract the path and reconstruct the backend URL
|
119
|
+
# print(parsed_url)
|
120
|
+
|
121
|
+
body: dict[str, str] = {
|
122
|
+
"path": parsed_url.path.lstrip("/"), # Remove leading slash
|
123
|
+
}
|
124
|
+
|
125
|
+
backend_url = backend_host + "/dwarfsource"
|
126
|
+
resp = httpx.post(
|
115
127
|
backend_url,
|
128
|
+
json=body,
|
116
129
|
timeout=100,
|
117
130
|
)
|
118
131
|
if resp.status_code != 200:
|
@@ -125,8 +138,8 @@ class FetchSourceFileTester(unittest.TestCase):
|
|
125
138
|
# Work in progress: get system include files.
|
126
139
|
# if resp.status_code != 200:
|
127
140
|
# raise Exception(f"Failed to fetch source file: {resp.status_code}")
|
128
|
-
# # error
|
129
|
-
# url = f"http://localhost:{http_port}/
|
141
|
+
# # error dwarfsource/js/drawfsour
|
142
|
+
# url = f"http://localhost:{http_port}/dwarfsource/js/dwarfsource/emsdk/upstream/emscripten/cache/sysroot/include/ctype.h"
|
130
143
|
# resp = httpx.get(
|
131
144
|
# url,
|
132
145
|
# timeout=100,
|
@@ -2,6 +2,7 @@
|
|
2
2
|
Unit test file.
|
3
3
|
"""
|
4
4
|
|
5
|
+
import os
|
5
6
|
import random
|
6
7
|
import time
|
7
8
|
import unittest
|
@@ -9,6 +10,8 @@ from pathlib import Path
|
|
9
10
|
|
10
11
|
import httpx
|
11
12
|
|
13
|
+
os.environ["FLASK_SERVER_LOGGING"] = "1"
|
14
|
+
|
12
15
|
from fastled import Test
|
13
16
|
|
14
17
|
HERE = Path(__file__).parent
|
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
|
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
|
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
|