fastled 1.3.18__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.18 → fastled-1.3.21}/Dockerfile +6 -8
- {fastled-1.3.18 → fastled-1.3.21}/PKG-INFO +1 -1
- {fastled-1.3.18 → fastled-1.3.21}/install +3 -4
- fastled-1.3.21/requirements.docker.txt +1 -0
- {fastled-1.3.18 → fastled-1.3.21}/requirements.testing.txt +0 -1
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/__version__.py +1 -1
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/server_flask.py +25 -76
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/util.py +2 -1
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/web_compile.py +1 -1
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled.egg-info/PKG-INFO +1 -1
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled.egg-info/SOURCES.txt +1 -0
- {fastled-1.3.18 → fastled-1.3.21}/tests/unit/test_banner_string.py +2 -2
- {fastled-1.3.18 → fastled-1.3.21}/tests/unit/test_debug_fetch_source_files.py +30 -17
- {fastled-1.3.18 → fastled-1.3.21}/tests/unit/test_http_server.py +3 -0
- {fastled-1.3.18 → fastled-1.3.21}/tests/unit/test_ino/bad_platformio/platformio.ini +1 -1
- {fastled-1.3.18 → fastled-1.3.21}/.aiderignore +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/.dockerignore +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/.github/workflows/build_multi_docker_image.yml +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/.github/workflows/build_webpage.yml +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/.github/workflows/lint.yml +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/.github/workflows/publish_release.yml +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/.github/workflows/template_build_docker_image.yml +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/.github/workflows/test_build_exe.yml +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/.github/workflows/test_macos.yml +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/.github/workflows/test_ubuntu.yml +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/.github/workflows/test_win.yml +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/.gitignore +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/.pylintrc +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/.vscode/launch.json +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/.vscode/settings.json +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/.vscode/tasks.json +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/DEBUGGER.md +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/FAQ.md +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/LICENSE +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/MANIFEST.in +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/README.md +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/RELEASE.md +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/TODO.md +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/build_exe.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/build_local_docker.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/build_site.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/clean +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/compiler/debug.sh +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/compiler/run.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/demo/100dots.html +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/demo/demo_threejs.html +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/demo/micdemo.html +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/demo/mp3upload.html +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/demo/webgl_postprocessing_unreal_bloom.html +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/docker-compose.yml +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/entrypoint.sh +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/install_linux.sh +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/lint +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/pyproject.toml +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/setup.cfg +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/setup.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/__init__.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/app.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/args.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/assets/example.txt +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/assets/localhost-key.pem +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/assets/localhost.pem +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/cli.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/cli_test.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/cli_test_interactive.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/client_server.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/compile_server.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/compile_server_impl.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/docker_manager.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/filewatcher.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/keyboard.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/keyz.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/live_client.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/open_browser.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/parse_args.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/paths.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/print_filter.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/project_init.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/select_sketch_directory.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/server_start.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/settings.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/site/build.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/site/examples.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/sketch.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/spinner.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/string_diff.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/test/can_run_local_docker_tests.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/test/examples.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/types.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled/version.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled.egg-info/dependency_links.txt +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled.egg-info/entry_points.txt +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled.egg-info/requires.txt +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/src/fastled.egg-info/top_level.txt +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/test +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/tests/integration/test_build_examples.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/tests/integration/test_examples.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/tests/unit/html/index.html +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/tests/unit/test_api.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/tests/unit/test_bad_ino.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/tests/unit/test_cli.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/tests/unit/test_compile_server.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/tests/unit/test_docker_linux_on_windows.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/tests/unit/test_embedded_data.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/tests/unit/test_filechanger.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/tests/unit/test_ino/bad/bad.ino +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/tests/unit/test_ino/bad_platformio/bad_platformio.ino +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/tests/unit/test_ino/embedded/data/bigdata.dat +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/tests/unit/test_ino/embedded/wasm.ino +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/tests/unit/test_ino/wasm/wasm.ino +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/tests/unit/test_project_init.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/tests/unit/test_server_and_client_seperatly.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/tests/unit/test_string_diff.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/tests/unit/test_version.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/tests/unit/test_webcompile.py +0 -0
- {fastled-1.3.18 → fastled-1.3.21}/upload_package.sh +0 -0
- {fastled-1.3.18 → 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,16 +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
|
+
logger.debug(f"_is_dwarf_source called with path: {path}")
|
31
32
|
if "dwarfsource" in path:
|
32
33
|
logger.debug(f"Path '{path}' contains 'dwarfsource'")
|
33
34
|
return True
|
34
|
-
|
35
|
-
|
36
|
-
path
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
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
|
41
44
|
|
42
45
|
|
43
46
|
def _run_flask_server(
|
@@ -139,70 +142,15 @@ def _run_flask_server(
|
|
139
142
|
logger.error(f"Error forwarding request: {e}", exc_info=True)
|
140
143
|
return Response(f"Error: {str(e)}", status=500)
|
141
144
|
|
142
|
-
def
|
143
|
-
"""Handle requests to
|
144
|
-
/fastledsource/js/fastledsource/git/fastled/src/
|
145
|
-
or
|
146
|
-
/sketchsource/js/src/Blink.ino
|
147
|
-
|
148
|
-
The names are a bit mangled due to the way C++ prefixing works near the root directory.
|
149
|
-
"""
|
150
|
-
from flask import request
|
151
|
-
|
152
|
-
start_time = time.time()
|
153
|
-
logger.info(f"Processing request: {request.method} {request.url}")
|
154
|
-
# Forward the request to the compile server
|
155
|
-
target_url = f"http://localhost:{compile_server_port}/dwarfsource/{path}"
|
156
|
-
logger.info(f"Requesting: {target_url}")
|
157
|
-
logger.info(f"Processing dwarfsource request for {path}")
|
158
|
-
|
159
|
-
# Log request headers
|
160
|
-
request_headers = {
|
161
|
-
key: value for key, value in request.headers if key != "Host"
|
162
|
-
}
|
163
|
-
logger.debug(f"Request headers: {request_headers}")
|
164
|
-
|
165
|
-
try:
|
166
|
-
# Forward the request with the same method, headers, and body
|
167
|
-
with httpx.Client() as client:
|
168
|
-
resp = client.request(
|
169
|
-
method=request.method,
|
170
|
-
url=target_url,
|
171
|
-
headers=request_headers,
|
172
|
-
content=request.get_data(),
|
173
|
-
cookies=request.cookies,
|
174
|
-
follow_redirects=True,
|
175
|
-
)
|
176
|
-
|
177
|
-
logger.info(f"Response status: {resp.status_code}")
|
178
|
-
logger.debug(f"Response headers: {dict(resp.headers)}")
|
179
|
-
|
180
|
-
# Create a Flask Response object from the httpx response
|
181
|
-
payload = resp.content
|
182
|
-
assert isinstance(payload, bytes)
|
183
|
-
|
184
|
-
# Check if the payload is empty
|
185
|
-
if len(payload) == 0:
|
186
|
-
logger.error("Empty payload received from compile server")
|
187
|
-
return Response("Empty payload", status=400)
|
188
|
-
|
189
|
-
response = Response(
|
190
|
-
payload, status=resp.status_code, headers=dict(resp.headers)
|
191
|
-
)
|
192
|
-
|
193
|
-
elapsed_time = time.time() - start_time
|
194
|
-
logger.info(f"Request completed in {elapsed_time:.3f} seconds")
|
195
|
-
|
196
|
-
return response
|
197
|
-
|
198
|
-
except Exception as e:
|
199
|
-
logger.error(f"Error handling dwarfsource request: {e}", exc_info=True)
|
200
|
-
return Response(f"Error: {str(e)}", status=500)
|
201
|
-
|
202
|
-
def handle_sourcefile(path: str) -> Response:
|
145
|
+
def handle_dwarfsource(path: str) -> Response:
|
203
146
|
"""Handle requests to /sourcefiles/*"""
|
204
147
|
from flask import Response, request
|
205
148
|
|
149
|
+
# Request body should be
|
150
|
+
# {
|
151
|
+
# "path": "string"
|
152
|
+
# }
|
153
|
+
|
206
154
|
start_time = time.time()
|
207
155
|
logger.info("\n##################################")
|
208
156
|
logger.info(f"# Serving source file /sourcefiles/ {path}")
|
@@ -211,7 +159,7 @@ def _run_flask_server(
|
|
211
159
|
logger.info(f"Processing sourcefile request for {path}")
|
212
160
|
|
213
161
|
# Forward the request to the compile server
|
214
|
-
target_url = f"http://localhost:{compile_server_port}/
|
162
|
+
target_url = f"http://localhost:{compile_server_port}/dwarfsource"
|
215
163
|
logger.info(f"Forwarding to: {target_url}")
|
216
164
|
|
217
165
|
# Log request headers
|
@@ -220,14 +168,18 @@ def _run_flask_server(
|
|
220
168
|
}
|
221
169
|
logger.debug(f"Request headers: {request_headers}")
|
222
170
|
|
171
|
+
body: dict[str, str] = {
|
172
|
+
"path": path,
|
173
|
+
}
|
174
|
+
|
223
175
|
try:
|
224
176
|
# Forward the request with the same method, headers, and body
|
225
177
|
with httpx.Client() as client:
|
226
178
|
resp = client.request(
|
227
|
-
method=
|
179
|
+
method="POST",
|
228
180
|
url=target_url,
|
229
181
|
headers=request_headers,
|
230
|
-
|
182
|
+
json=body,
|
231
183
|
cookies=request.cookies,
|
232
184
|
follow_redirects=True,
|
233
185
|
)
|
@@ -341,11 +293,8 @@ def _run_flask_server(
|
|
341
293
|
is_debug_src_code_request = _is_dwarf_source(path)
|
342
294
|
logger.info(f"is debug_src_code_request: {is_debug_src_code_request}")
|
343
295
|
if is_debug_src_code_request:
|
344
|
-
logger.info(f"Handling as
|
345
|
-
return
|
346
|
-
elif path.startswith("sourcefiles/"):
|
347
|
-
logger.info(f"Handling as sourcefiles: {path}")
|
348
|
-
return handle_sourcefile(path)
|
296
|
+
logger.info(f"Handling as dwarf source file request: {path}")
|
297
|
+
return handle_dwarfsource(path)
|
349
298
|
else:
|
350
299
|
logger.info(f"Handling as local file: {path}")
|
351
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
|