delete after seal#20
Conversation
|
ack |
| print(f"unlocks: {unlock_at.astimezone().isoformat()}") | ||
| if pw is None: | ||
| print(_style.dim("no password set, so anyone can open it after that date")) | ||
|
|
There was a problem hiding this comment.
before removing, check if capsule was written correctly
example
with open(out, "wb") as fh:
fh.write(blob)
with open(out, "rb") as fh:
written = fh.read()
if written != blob:
raise IOError("File content mismatch after write")| print(f"unlocks: {unlock_at.astimezone().isoformat()}") | ||
| if pw is None: | ||
| print(_style.dim("no password set, so anyone can open it after that date")) | ||
|
|
|
so if everything goes wrong (God choose that execution to perform an partial write), we need this verification. While I do see the purpose, it seems like an overhead perform an read after the write on the same file. What do you think on a lighter version: if os.path.getsize(out) != len(blob):
raise IOError("Capsule size mismatch") |
|
looks reasonable to me |
|
have u tested it locally? |
|
yes, I will be attaching proof as soon as I commit the size verifcation |
|
seems like you working really hard |
|
aww |
|
the lint |
|
i hate this lint |
There was a problem hiding this comment.
Pull request overview
Adds an optional --rm flag to the seal command so users can delete staged inputs after successfully sealing them into a capsule, along with documentation and tests to cover the new behavior.
Changes:
- Add
--rmCLI flag tomagicicapsula sealand implement post-seal deletion of staged paths. - Add a post-write size verification check to detect unexpected write corruption.
- Extend command-layer tests and update README usage docs accordingly.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
magicicapsula/commands/seal.py |
Adds --rm support, deletes staged paths after sealing, and verifies output size after write. |
tests/commands/test_capsule_commands.py |
Updates seal command tests for the new rm arg and adds new test cases for --rm and size verification. |
README.md |
Documents the new --rm flag in the seal command help snippet. |
.gitignore |
Ignores .vscode/ editor settings directory. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
did da linty no pass? 🥺👉👈 aww don wowwy babyy... it no pass cuz ur fiwe not fowmatted pwoperly 🥹✨ jus wun da fowmatter and evewyting gon be otay 💅💖 iti mawia 🐛💕 |
|
this is hel |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
welcome to the black parade |
|
ok |
|
thanks! |
|
u welcome! |
|
oopsie woopsie 🚨 da lint went 🔴❌ not cuz u dumb but cuz spacing all wonky wonky 🫠 fix da fowmat and he go 🟢✅ yayyy 🎉🐛 |
|
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣠⡤⠤⠤⠤⢤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ |
#14