Conversation
tekknolagi
left a comment
There was a problem hiding this comment.
Nice first commit. It would be good to see some design sketches of where this is going so that I can help you integrate it into the codebase
For example: will the server eventually take uploads?
In general, I would like to see some communication before dropping PRs over the wall, especially if they bring bigger changes. Creating an issue is a good way to do distributed development so that others (Chris, Abel) can chime in.
Thanks for the feedback! I'll follow up with a few issues where we can discuss implementation before I dive into future PRs |
|
If you rebase on latest trunk, the unit test errors that are "my" fault go away |
Implemented a new `server_command` function to serve `.scrap` files over HTTP, allowing retrieval by path or hash. Added error handling for missing files. Included unit tests for server functionality in `scrapscript_tests.py` to ensure proper operation and error responses.
Co-authored-by: Max Bernstein <tekknolagi@gmail.com>
Co-authored-by: Max Bernstein <tekknolagi@gmail.com>
Updated `scrapscript_tests.py` to dynamically determine the host and port for server tests, enhancing reliability. Modified `scrapscript.py` to validate scrap file names using regex and adjusted content disposition header formatting. Defaulted the directory argument in the server command to improve usability.
Updated `scrapscript_tests.py` to streamline import statements and enhance code readability. Added `urllib.request` import at the top and organized other imports in the `setUp` method for better clarity.
…debug argument Updated `scrapscript_tests.py` to specifically catch `ConnectionRefusedError` and `socket.timeout` exceptions for improved error handling during server connection tests. Removed the unused `--debug` argument from the server command in `scrapscript.py` to streamline argument parsing.
b0c899a to
83879c8
Compare
server_command uses abspath internally.
|
Thanks for grabbing those fixes! LGTM 👍🏼 I'm unsure if you want to fix the failing deployments first, so feel free to merge at your leisure |
|
Failing deployments are because you're the author, not me. It's a non-issue |
Implemented a new
server_commandfunction to serve.scrapfiles over HTTP, allowing retrieval by path or hash. Added error handling for missing files. Included unit tests for server functionality inscrapscript_tests.pyto ensure proper operation and error responses.