fix: allow mining directories without local mempalace.yaml - #173
Closed
mvanhorn wants to merge 2 commits into
Closed
fix: allow mining directories without local mempalace.yaml#173mvanhorn wants to merge 2 commits into
mvanhorn wants to merge 2 commits into
Conversation
When no mempalace.yaml or mempal.yaml exists in the source directory, return a default config (wing = directory name, room = general) instead of calling sys.exit(1). This lets users mine any directory into their palace without requiring init first. Closes MemPalace#14.
|
"The fix: when no yaml is found, derive a wing name from the directory basename and use a single "general" room. Prints an informational message instead of crashing." -- what does the general informational message look like out of curiosity? |
Contributor
Author
|
It prints: Then uses the directory basename as the wing name and a single "general" room with all project files. |
Contributor
|
Conflicts with main. If the mining-without-yaml feature is still needed, a rebased PR against current main would be welcome. |
Contributor
Author
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Changes
load_config()inminer.pyto return sensible defaults instead ofsys.exit(1)when nomempalace.yamlexists in the source directory.The bug:
mempalace mine ~/chats/fails withERROR: No mempalace.yaml foundwhen the user init'd in a different directory (~/projects/myapp). The miner requiresmempalace.yamlin every source directory, but users expect to init once and mine from anywhere.The fix: when no yaml is found, derive a wing name from the directory basename and use a single "general" room. Prints an informational message instead of crashing.
Closes #14.
How to test
Or run the new test:
Checklist
python -m pytest tests/ -v)ruff check .)This contribution was developed with AI assistance (Codex).