fastled 1.2.83__py3-none-any.whl → 1.2.86__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 +8 -2
- fastled/server_flask.py +321 -115
- {fastled-1.2.83.dist-info → fastled-1.2.86.dist-info}/METADATA +1 -1
- {fastled-1.2.83.dist-info → fastled-1.2.86.dist-info}/RECORD +9 -9
- {fastled-1.2.83.dist-info → fastled-1.2.86.dist-info}/WHEEL +0 -0
- {fastled-1.2.83.dist-info → fastled-1.2.86.dist-info}/entry_points.txt +0 -0
- {fastled-1.2.83.dist-info → fastled-1.2.86.dist-info}/licenses/LICENSE +0 -0
- {fastled-1.2.83.dist-info → fastled-1.2.86.dist-info}/top_level.txt +0 -0
fastled/__init__.py
CHANGED
@@ -14,7 +14,7 @@ from .types import BuildMode, CompileResult, CompileServerError, FileResponse
|
|
14
14
|
# IMPORTANT! There's a bug in github which will REJECT any version update
|
15
15
|
# that has any other change in the repo. Please bump the version as the
|
16
16
|
# ONLY change in a commit, or else the pypi update and the release will fail.
|
17
|
-
__version__ = "1.2.
|
17
|
+
__version__ = "1.2.86"
|
18
18
|
|
19
19
|
|
20
20
|
class Api:
|
fastled/client_server.py
CHANGED
@@ -63,6 +63,12 @@ def TEST_BEFORE_COMPILE(url) -> None:
|
|
63
63
|
pass
|
64
64
|
|
65
65
|
|
66
|
+
def _chunked_print(stdout: str) -> None:
|
67
|
+
lines = stdout.splitlines()
|
68
|
+
for line in lines:
|
69
|
+
print(line)
|
70
|
+
|
71
|
+
|
66
72
|
def _run_web_compiler(
|
67
73
|
directory: Path,
|
68
74
|
host: str,
|
@@ -80,7 +86,7 @@ def _run_web_compiler(
|
|
80
86
|
if not web_result.success:
|
81
87
|
print("\nWeb compilation failed:")
|
82
88
|
print(f"Time taken: {diff:.2f} seconds")
|
83
|
-
|
89
|
+
_chunked_print(web_result.stdout)
|
84
90
|
# Create error page
|
85
91
|
output_dir.mkdir(exist_ok=True)
|
86
92
|
error_html = _create_error_html(web_result.stdout)
|
@@ -117,7 +123,7 @@ def _run_web_compiler(
|
|
117
123
|
# Extract zip contents
|
118
124
|
shutil.unpack_archive(temp_zip, output_dir, "zip")
|
119
125
|
|
120
|
-
|
126
|
+
_chunked_print(web_result.stdout)
|
121
127
|
print_results()
|
122
128
|
return web_result
|
123
129
|
|
fastled/server_flask.py
CHANGED
@@ -1,11 +1,30 @@
|
|
1
1
|
import argparse
|
2
|
+
import logging
|
3
|
+
import time
|
2
4
|
from multiprocessing import Process
|
3
5
|
from pathlib import Path
|
4
6
|
|
5
|
-
import
|
7
|
+
import httpx
|
6
8
|
from livereload import Server
|
7
9
|
|
8
|
-
|
10
|
+
# Logging configuration
|
11
|
+
_ENABLE_LOGGING = False # Set to False to disable logging
|
12
|
+
|
13
|
+
if _ENABLE_LOGGING:
|
14
|
+
logging.basicConfig(
|
15
|
+
level=logging.INFO,
|
16
|
+
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
|
17
|
+
)
|
18
|
+
logger = logging.getLogger("flask_server")
|
19
|
+
else:
|
20
|
+
# Disable all logging
|
21
|
+
logging.getLogger("flask_server").addHandler(logging.NullHandler())
|
22
|
+
logging.getLogger("flask_server").propagate = False
|
23
|
+
logger = logging.getLogger("flask_server")
|
24
|
+
logger.disabled = True
|
25
|
+
|
26
|
+
_DRAWF_SOURCE_FASTLED = "drawfsource/js/fastled/src/"
|
27
|
+
_DRAWF_SOURCE_EMSDK = "drawfsource/js/drawfsource/emsdk/"
|
9
28
|
|
10
29
|
|
11
30
|
def _run_flask_server(
|
@@ -24,170 +43,327 @@ def _run_flask_server(
|
|
24
43
|
keyfile: Path to the SSL key file
|
25
44
|
"""
|
26
45
|
try:
|
27
|
-
from flask import Flask, Response, send_from_directory
|
46
|
+
from flask import Flask, Response, request, send_from_directory
|
28
47
|
|
29
48
|
app = Flask(__name__)
|
30
49
|
|
31
50
|
# Must be a full path or flask will fail to find the file.
|
32
51
|
fastled_js = fastled_js.resolve()
|
33
52
|
|
34
|
-
|
53
|
+
# logger.error(f"Server error: {e}")
|
54
|
+
|
55
|
+
@app.before_request
|
56
|
+
def log_request_info():
|
57
|
+
"""Log details of each request before processing"""
|
58
|
+
if _ENABLE_LOGGING:
|
59
|
+
logger.info("=" * 80)
|
60
|
+
logger.info(f"Request: {request.method} {request.url}")
|
61
|
+
logger.info(f"Headers: {dict(request.headers)}")
|
62
|
+
logger.info(f"Args: {dict(request.args)}")
|
63
|
+
if request.is_json:
|
64
|
+
logger.info(f"JSON: {request.json}")
|
65
|
+
if request.form:
|
66
|
+
logger.info(f"Form: {dict(request.form)}")
|
67
|
+
logger.info(f"Remote addr: {request.remote_addr}")
|
68
|
+
logger.info(f"User agent: {request.user_agent}")
|
35
69
|
|
36
70
|
@app.route("/")
|
37
71
|
def serve_index():
|
38
|
-
|
72
|
+
if _ENABLE_LOGGING:
|
73
|
+
logger.info("Serving index.html")
|
74
|
+
response = send_from_directory(fastled_js, "index.html")
|
75
|
+
if _ENABLE_LOGGING:
|
76
|
+
logger.info(f"Index response status: {response.status_code}")
|
77
|
+
return response
|
39
78
|
|
40
79
|
@app.route("/sourcefiles/<path:path>")
|
41
80
|
def serve_source_files(path):
|
42
81
|
"""Proxy requests to /sourcefiles/* to the compile server"""
|
43
82
|
from flask import request
|
44
83
|
|
84
|
+
start_time = time.time()
|
85
|
+
logger.info(f"Serving source file: {path}")
|
86
|
+
|
45
87
|
# Forward the request to the compile server
|
46
88
|
target_url = f"http://localhost:{compile_server_port}/sourcefiles/{path}"
|
89
|
+
logger.info(f"Forwarding to: {target_url}")
|
90
|
+
|
91
|
+
# Log request headers
|
92
|
+
request_headers = {
|
93
|
+
key: value for key, value in request.headers if key != "Host"
|
94
|
+
}
|
95
|
+
logger.debug(f"Request headers: {request_headers}")
|
47
96
|
|
48
97
|
# Forward the request with the same method, headers, and body
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
# Create a Flask Response object from the requests response
|
60
|
-
response = Response(
|
61
|
-
resp.raw.read(), status=resp.status_code, headers=dict(resp.headers)
|
62
|
-
)
|
98
|
+
try:
|
99
|
+
with httpx.Client() as client:
|
100
|
+
resp = client.request(
|
101
|
+
method=request.method,
|
102
|
+
url=target_url,
|
103
|
+
headers=request_headers,
|
104
|
+
content=request.get_data(),
|
105
|
+
cookies=request.cookies,
|
106
|
+
follow_redirects=True,
|
107
|
+
)
|
63
108
|
|
64
|
-
|
109
|
+
logger.info(f"Response status: {resp.status_code}")
|
110
|
+
logger.debug(f"Response headers: {dict(resp.headers)}")
|
111
|
+
|
112
|
+
# Create a Flask Response object from the httpx response
|
113
|
+
raw_data = resp.content
|
114
|
+
logger.debug(f"Response size: {len(raw_data)} bytes")
|
115
|
+
|
116
|
+
response = Response(
|
117
|
+
raw_data, status=resp.status_code, headers=dict(resp.headers)
|
118
|
+
)
|
119
|
+
|
120
|
+
elapsed_time = time.time() - start_time
|
121
|
+
logger.info(f"Request completed in {elapsed_time:.3f} seconds")
|
122
|
+
|
123
|
+
return response
|
124
|
+
|
125
|
+
except Exception as e:
|
126
|
+
logger.error(f"Error forwarding request: {e}", exc_info=True)
|
127
|
+
return Response(f"Error: {str(e)}", status=500)
|
65
128
|
|
66
129
|
def handle_dwarfsource(path: str) -> Response:
|
67
|
-
"""Handle requests to /drawfsource/js/fastled/src/
|
130
|
+
"""Handle requests to /drawfsource/js/fastled/src/
|
131
|
+
or /drawfsource/js/drawfsource/emsdk/*"""
|
68
132
|
from flask import request
|
69
133
|
|
70
|
-
|
71
|
-
|
72
|
-
print("##################################\n")
|
134
|
+
start_time = time.time()
|
135
|
+
logger.info(f"Processing request: {request.method} {request.url}")
|
73
136
|
|
74
|
-
if
|
137
|
+
if "../" in path:
|
138
|
+
# Prevent directory traversal attacks
|
139
|
+
error_msg = "Directory traversal attack detected"
|
140
|
+
logger.error(error_msg)
|
141
|
+
return Response(error_msg, status=400)
|
142
|
+
|
143
|
+
if not path.startswith(_DRAWF_SOURCE_FASTLED) and not path.startswith(
|
144
|
+
_DRAWF_SOURCE_EMSDK
|
145
|
+
):
|
75
146
|
# unexpected
|
76
|
-
|
147
|
+
error_msg = f"Unexpected path: {path}"
|
148
|
+
logger.error(error_msg)
|
149
|
+
# Logging disabled
|
77
150
|
return Response("Malformed path", status=400)
|
78
151
|
|
79
|
-
|
152
|
+
# Weird magic being played with these paths, it's beyond me.
|
153
|
+
if path.startswith(_DRAWF_SOURCE_FASTLED):
|
154
|
+
path = path[len("/drawfsource") :]
|
80
155
|
|
81
156
|
# Forward the request to the compile server
|
82
|
-
target_url = f"http://localhost:{compile_server_port}/
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
157
|
+
target_url = f"http://localhost:{compile_server_port}/drawfsource/{path}"
|
158
|
+
logger.info(f"Requesting: {target_url}")
|
159
|
+
logger.info(f"Processing dwarfsource request for {path}")
|
160
|
+
|
161
|
+
# Log request headers
|
162
|
+
request_headers = {
|
163
|
+
key: value for key, value in request.headers if key != "Host"
|
164
|
+
}
|
165
|
+
logger.debug(f"Request headers: {request_headers}")
|
166
|
+
|
167
|
+
try:
|
168
|
+
# Forward the request with the same method, headers, and body
|
169
|
+
with httpx.Client() as client:
|
170
|
+
resp = client.request(
|
171
|
+
method=request.method,
|
172
|
+
url=target_url,
|
173
|
+
headers=request_headers,
|
174
|
+
content=request.get_data(),
|
175
|
+
cookies=request.cookies,
|
176
|
+
follow_redirects=True,
|
177
|
+
)
|
178
|
+
|
179
|
+
logger.info(f"Response status: {resp.status_code}")
|
180
|
+
logger.debug(f"Response headers: {dict(resp.headers)}")
|
181
|
+
|
182
|
+
# Create a Flask Response object from the httpx response
|
183
|
+
payload = resp.content
|
184
|
+
assert isinstance(payload, bytes)
|
185
|
+
|
186
|
+
# Check if the payload is empty
|
187
|
+
if len(payload) == 0:
|
188
|
+
logger.error("Empty payload received from compile server")
|
189
|
+
return Response("Empty payload", status=400)
|
190
|
+
|
191
|
+
response = Response(
|
192
|
+
payload, status=resp.status_code, headers=dict(resp.headers)
|
193
|
+
)
|
194
|
+
|
195
|
+
elapsed_time = time.time() - start_time
|
196
|
+
logger.info(f"Request completed in {elapsed_time:.3f} seconds")
|
197
|
+
|
198
|
+
return response
|
199
|
+
|
200
|
+
except Exception as e:
|
201
|
+
logger.error(f"Error handling dwarfsource request: {e}", exc_info=True)
|
202
|
+
return Response(f"Error: {str(e)}", status=500)
|
101
203
|
|
102
204
|
def handle_sourcefile(path: str) -> Response:
|
103
205
|
"""Handle requests to /sourcefiles/*"""
|
104
206
|
from flask import Response, request
|
105
207
|
|
106
|
-
|
107
|
-
|
108
|
-
|
208
|
+
start_time = time.time()
|
209
|
+
logger.info("\n##################################")
|
210
|
+
logger.info(f"# Serving source file /sourcefiles/ {path}")
|
211
|
+
logger.info("##################################\n")
|
212
|
+
|
213
|
+
logger.info(f"Processing sourcefile request for {path}")
|
109
214
|
|
110
215
|
# Forward the request to the compile server
|
111
216
|
target_url = f"http://localhost:{compile_server_port}/sourcefiles/{path}"
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
217
|
+
logger.info(f"Forwarding to: {target_url}")
|
218
|
+
|
219
|
+
# Log request headers
|
220
|
+
request_headers = {
|
221
|
+
key: value for key, value in request.headers if key != "Host"
|
222
|
+
}
|
223
|
+
logger.debug(f"Request headers: {request_headers}")
|
224
|
+
|
225
|
+
try:
|
226
|
+
# Forward the request with the same method, headers, and body
|
227
|
+
with httpx.Client() as client:
|
228
|
+
resp = client.request(
|
229
|
+
method=request.method,
|
230
|
+
url=target_url,
|
231
|
+
headers=request_headers,
|
232
|
+
content=request.get_data(),
|
233
|
+
cookies=request.cookies,
|
234
|
+
follow_redirects=True,
|
235
|
+
)
|
236
|
+
|
237
|
+
logger.info(f"Response status: {resp.status_code}")
|
238
|
+
logger.debug(f"Response headers: {dict(resp.headers)}")
|
239
|
+
|
240
|
+
# Create a Flask Response object from the httpx response
|
241
|
+
raw_data = resp.content
|
242
|
+
logger.debug(f"Response size: {len(raw_data)} bytes")
|
243
|
+
|
244
|
+
response = Response(
|
245
|
+
raw_data, status=resp.status_code, headers=dict(resp.headers)
|
246
|
+
)
|
247
|
+
|
248
|
+
elapsed_time = time.time() - start_time
|
249
|
+
logger.info(f"Request completed in {elapsed_time:.3f} seconds")
|
250
|
+
|
251
|
+
return response
|
252
|
+
|
253
|
+
except Exception as e:
|
254
|
+
logger.error(f"Error handling sourcefile request: {e}", exc_info=True)
|
255
|
+
return Response(f"Error: {str(e)}", status=500)
|
130
256
|
|
131
257
|
def handle_local_file_fetch(path: str) -> Response:
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
258
|
+
start_time = time.time()
|
259
|
+
logger.info("\n##################################")
|
260
|
+
logger.info(f"# Serving generic file {path}")
|
261
|
+
logger.info("##################################\n")
|
262
|
+
|
263
|
+
logger.info(f"Processing local file request for {path}")
|
264
|
+
|
265
|
+
try:
|
266
|
+
file_path = fastled_js / path
|
267
|
+
logger.info(f"Full file path: {file_path}")
|
268
|
+
logger.info(f"File exists: {file_path.exists()}")
|
269
|
+
|
270
|
+
# Check if file exists before trying to serve it
|
271
|
+
if not file_path.exists():
|
272
|
+
logger.warning(f"File not found: {file_path}")
|
273
|
+
return Response(f"File not found: {path}", status=404)
|
274
|
+
|
275
|
+
response = send_from_directory(fastled_js, path)
|
276
|
+
|
277
|
+
# Some servers don't set the Content-Type header for a bunch of files.
|
278
|
+
content_type = None
|
279
|
+
if path.endswith(".js"):
|
280
|
+
content_type = "application/javascript"
|
281
|
+
elif path.endswith(".css"):
|
282
|
+
content_type = "text/css"
|
283
|
+
elif path.endswith(".wasm"):
|
284
|
+
content_type = "application/wasm"
|
285
|
+
elif path.endswith(".json"):
|
286
|
+
content_type = "application/json"
|
287
|
+
elif path.endswith(".png"):
|
288
|
+
content_type = "image/png"
|
289
|
+
elif path.endswith(".jpg") or path.endswith(".jpeg"):
|
290
|
+
content_type = "image/jpeg"
|
291
|
+
elif path.endswith(".gif"):
|
292
|
+
content_type = "image/gif"
|
293
|
+
elif path.endswith(".svg"):
|
294
|
+
content_type = "image/svg+xml"
|
295
|
+
elif path.endswith(".ico"):
|
296
|
+
content_type = "image/x-icon"
|
297
|
+
elif path.endswith(".html"):
|
298
|
+
content_type = "text/html"
|
299
|
+
|
300
|
+
if content_type:
|
301
|
+
logger.info(f"Setting Content-Type to {content_type}")
|
302
|
+
response.headers["Content-Type"] = content_type
|
303
|
+
|
304
|
+
# now also add headers to force no caching
|
305
|
+
response.headers["Cache-Control"] = (
|
306
|
+
"no-cache, no-store, must-revalidate"
|
307
|
+
)
|
308
|
+
response.headers["Pragma"] = "no-cache"
|
309
|
+
response.headers["Expires"] = "0"
|
310
|
+
|
311
|
+
logger.info(f"Response status: {response.status_code}")
|
312
|
+
logger.debug(f"Response headers: {dict(response.headers)}")
|
313
|
+
|
314
|
+
elapsed_time = time.time() - start_time
|
315
|
+
logger.info(f"Request completed in {elapsed_time:.3f} seconds")
|
316
|
+
|
317
|
+
return response
|
318
|
+
|
319
|
+
except Exception as e:
|
320
|
+
logger.error(f"Error serving local file {path}: {e}", exc_info=True)
|
321
|
+
# Check if this is a FileNotFoundError (which can happen with send_from_directory)
|
322
|
+
if isinstance(e, FileNotFoundError):
|
323
|
+
return Response(f"File not found: {path}", status=404)
|
324
|
+
return Response(f"Error serving file: {str(e)}", status=500)
|
167
325
|
|
168
326
|
@app.route("/<path:path>")
|
169
327
|
def serve_files(path: str):
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
328
|
+
logger.info(f"Received request for path: {path}")
|
329
|
+
|
330
|
+
try:
|
331
|
+
if path.startswith("drawfsource/"):
|
332
|
+
logger.info(f"Handling as drawfsource: {path}")
|
333
|
+
return handle_dwarfsource(path)
|
334
|
+
elif path.startswith("sourcefiles/"):
|
335
|
+
logger.info(f"Handling as sourcefiles: {path}")
|
336
|
+
return handle_sourcefile(path)
|
337
|
+
else:
|
338
|
+
logger.info(f"Handling as local file: {path}")
|
339
|
+
return handle_local_file_fetch(path)
|
340
|
+
except Exception as e:
|
341
|
+
logger.error(f"Error in serve_files for {path}: {e}", exc_info=True)
|
342
|
+
return Response(f"Server error: {str(e)}", status=500)
|
343
|
+
|
344
|
+
@app.errorhandler(Exception)
|
345
|
+
def handle_exception(e):
|
346
|
+
"""Log any uncaught exceptions"""
|
347
|
+
logger.error(f"Unhandled exception: {e}", exc_info=True)
|
348
|
+
return Response(f"Server error: {str(e)}", status=500)
|
349
|
+
|
350
|
+
logger.info("Setting up livereload server")
|
178
351
|
server = Server(app.wsgi_app)
|
179
352
|
# Watch index.html for changes
|
180
353
|
server.watch(str(fastled_js / "index.html"))
|
181
354
|
# server.watch(str(fastled_js / "index.js"))
|
182
355
|
# server.watch(str(fastled_js / "index.css"))
|
183
356
|
# Start the server
|
357
|
+
logger.info(f"Starting server on port {port}")
|
184
358
|
server.serve(port=port, debug=True)
|
185
359
|
except KeyboardInterrupt:
|
360
|
+
logger.info("Server stopped by keyboard interrupt")
|
186
361
|
import _thread
|
187
362
|
|
188
363
|
_thread.interrupt_main()
|
189
364
|
except Exception as e:
|
190
|
-
|
365
|
+
logger.error(f"Failed to run Flask server: {e}", exc_info=True)
|
366
|
+
logger.info("Flask server thread running")
|
191
367
|
import _thread
|
192
368
|
|
193
369
|
_thread.interrupt_main()
|
@@ -202,15 +378,24 @@ def run_flask_in_thread(
|
|
202
378
|
) -> None:
|
203
379
|
"""Run the Flask server."""
|
204
380
|
try:
|
205
|
-
|
206
|
-
|
381
|
+
if _ENABLE_LOGGING:
|
382
|
+
logger.info(f"Starting Flask server thread on port {port}")
|
383
|
+
logger.info(f"Serving files from {cwd}")
|
384
|
+
logger.info(f"Compile server port: {compile_server_port}")
|
385
|
+
if certfile:
|
386
|
+
logger.info(f"Using SSL certificate: {certfile}")
|
387
|
+
if keyfile:
|
388
|
+
logger.info(f"Using SSL key: {keyfile}")
|
207
389
|
|
208
|
-
|
390
|
+
_run_flask_server(cwd, port, compile_server_port, certfile, keyfile)
|
209
391
|
except KeyboardInterrupt:
|
392
|
+
logger.info("Flask server thread stopped by keyboard interrupt")
|
210
393
|
import _thread
|
211
394
|
|
212
395
|
_thread.interrupt_main()
|
213
396
|
pass
|
397
|
+
except Exception as e:
|
398
|
+
logger.error(f"Error in Flask server thread: {e}", exc_info=True)
|
214
399
|
|
215
400
|
|
216
401
|
def parse_args() -> argparse.Namespace:
|
@@ -249,18 +434,39 @@ def run_flask_server_process(
|
|
249
434
|
keyfile: Path | None = None,
|
250
435
|
) -> Process:
|
251
436
|
"""Run the Flask server in a separate process."""
|
437
|
+
if _ENABLE_LOGGING:
|
438
|
+
logger.info(f"Starting Flask server process on port {port}")
|
439
|
+
logger.info(f"Serving files from {cwd}")
|
440
|
+
logger.info(f"Compile server port: {compile_server_port}")
|
441
|
+
|
252
442
|
process = Process(
|
253
443
|
target=run_flask_in_thread,
|
254
444
|
args=(port, cwd, compile_server_port, certfile, keyfile),
|
255
445
|
)
|
256
446
|
process.start()
|
447
|
+
if _ENABLE_LOGGING:
|
448
|
+
logger.info(f"Flask server process started with PID {process.pid}")
|
257
449
|
return process
|
258
450
|
|
259
451
|
|
260
452
|
def main() -> None:
|
261
453
|
"""Main function."""
|
454
|
+
if _ENABLE_LOGGING:
|
455
|
+
logger.info("Starting main function")
|
262
456
|
args = parse_args()
|
263
|
-
|
457
|
+
if _ENABLE_LOGGING:
|
458
|
+
logger.info(f"Arguments: port={args.port}, fastled_js={args.fastled_js}")
|
459
|
+
if args.certfile:
|
460
|
+
logger.info(f"Using SSL certificate: {args.certfile}")
|
461
|
+
if args.keyfile:
|
462
|
+
logger.info(f"Using SSL key: {args.keyfile}")
|
463
|
+
logger.warning("Note: main() is missing compile_server_port parameter")
|
464
|
+
|
465
|
+
# Note: This call is missing the compile_server_port parameter
|
466
|
+
# This is a bug in the original code
|
467
|
+
run_flask_in_thread(args.port, args.fastled_js, 0, args.certfile, args.keyfile)
|
468
|
+
if _ENABLE_LOGGING:
|
469
|
+
logger.info("Main function completed")
|
264
470
|
|
265
471
|
|
266
472
|
if __name__ == "__main__":
|
@@ -1,9 +1,9 @@
|
|
1
|
-
fastled/__init__.py,sha256=
|
1
|
+
fastled/__init__.py,sha256=5byUn4uJ2EvnYRkab1dfNKQOoRV4SA5W2nRLLJcbY3w,7044
|
2
2
|
fastled/app.py,sha256=0W8Mbplo5UCRzj7nMVgkmCBddQGufsUQjkUUT4pMp74,4611
|
3
3
|
fastled/cli.py,sha256=FjVr31ht0UPlAcmX-84NwfAGMQHTkrCe4o744jCAxiw,375
|
4
4
|
fastled/cli_test.py,sha256=qJB9yLRFR3OwOwdIWSQ0fQsWLnA37v5pDccufiP_hTs,512
|
5
5
|
fastled/cli_test_interactive.py,sha256=BjNhveZOk5aCffHbcrxPQQjWmAuj4ClVKKcKX5eY6yM,542
|
6
|
-
fastled/client_server.py,sha256=
|
6
|
+
fastled/client_server.py,sha256=4oRDccFMifTZPPtOYIfo4xJBJ8oE7gylVF75Rhytwig,17319
|
7
7
|
fastled/compile_server.py,sha256=sRiXYzw7lv9vcWJWGPUkzOGZPmvZGV_TGwbHYoRc15s,3155
|
8
8
|
fastled/compile_server_impl.py,sha256=t7y19DDB0auH1MmYLCi4yjc_ZyDUJ-WHy14QWTJ-pq8,13043
|
9
9
|
fastled/docker_manager.py,sha256=SC_qV6grNTGh0QD1ubKrULQblrN-2PORocISlaZg9NQ,35156
|
@@ -17,7 +17,7 @@ fastled/paths.py,sha256=VsPmgu0lNSCFOoEC0BsTYzDygXqy15AHUfN-tTuzDZA,99
|
|
17
17
|
fastled/print_filter.py,sha256=ZpebuqfWEraSBD3Dm0PVZhQVBnU_NSILniwBHwjC1qM,2342
|
18
18
|
fastled/project_init.py,sha256=bBt4DwmW5hZkm9ICt9Qk-0Nr_0JQM7icCgH5Iv-bCQs,3984
|
19
19
|
fastled/select_sketch_directory.py,sha256=-eudwCns3AKj4HuHtSkZAFwbnf005SNL07pOzs9VxnE,1383
|
20
|
-
fastled/server_flask.py,sha256=
|
20
|
+
fastled/server_flask.py,sha256=fbLuF993pbBqoyMbjHT1GPwjlxBib3cUUW719PNfN1w,18108
|
21
21
|
fastled/server_start.py,sha256=W9yKStkRlRNuXeV6j_6O7HjjFPyVLBHMcF9Uy2QjDWQ,479
|
22
22
|
fastled/settings.py,sha256=oezRvRUJWwauO-kpC4LDbKg6Q-ij4d09UtR2vkjSAPU,575
|
23
23
|
fastled/sketch.py,sha256=tHckjDj8P6BI_LWzUFM071a9qcqPs-r-qFWIe50P5Xw,3391
|
@@ -33,9 +33,9 @@ fastled/site/build.py,sha256=2YKU_UWKlJdGnjdbAbaL0co6kceFMSTVYwH1KCmgPZA,13987
|
|
33
33
|
fastled/site/examples.py,sha256=s6vj2zJc6BfKlnbwXr1QWY1mzuDBMt6j5MEBOWjO_U8,155
|
34
34
|
fastled/test/can_run_local_docker_tests.py,sha256=LEuUbHctRhNNFWcvnz2kEGmjDJeXO4c3kNpizm3yVJs,400
|
35
35
|
fastled/test/examples.py,sha256=GfaHeY1E8izBl6ZqDVjz--RHLyVR4NRnQ5pBesCFJFY,1673
|
36
|
-
fastled-1.2.
|
37
|
-
fastled-1.2.
|
38
|
-
fastled-1.2.
|
39
|
-
fastled-1.2.
|
40
|
-
fastled-1.2.
|
41
|
-
fastled-1.2.
|
36
|
+
fastled-1.2.86.dist-info/licenses/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
|
37
|
+
fastled-1.2.86.dist-info/METADATA,sha256=Y3dWMsj_2bo2uKzkBTYAaUhVMQKjJsNu8FVmjrChKDk,21940
|
38
|
+
fastled-1.2.86.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
39
|
+
fastled-1.2.86.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
|
40
|
+
fastled-1.2.86.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
|
41
|
+
fastled-1.2.86.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|