feat(puid): add custom lookup table in config#32
Merged
vEnhance merged 4 commits intovEnhance:mainfrom Mar 17, 2025
Merged
Conversation
Contributor
Author
|
yay it looks like pyright and ruff diagnostics in nvim have worked |
vEnhance
reviewed
Mar 16, 2025
Owner
|
made some changes:
abbreviations:
Inter Galaxy Math Olympiad: IGMO
Inter Universe Math Olympiad: IUMOOverall diff: diff --git a/von/rc.py b/von/rc.py
index c6708c5..4c3560b 100644
--- a/von/rc.py
+++ b/von/rc.py
@@ -51,12 +51,12 @@ tags: ["trivial", "easy", "medium", "hard", "brutal"]
# By default, it detects from $EDITOR automatically
# editor: vim
-# If you would like to define a custom contest name
-# (to be used in the PUID script), then you should
-# define it here. This will also override any "standard"
-# lookups in `puid.py`. (This should be in python dictionary
-# format)
-# lookup: {"contest-1": "abbreviation-1", "contest-2": "abbreviation-2"}
+# If you would like to define a custom contest name (to be used in the PUID script),
+# then you should define it here.
+# This will also override any "standard" lookups in `puid.py`.
+# abbreviations:
+# Inter Galaxy Math Olympiad: IGMO
+# Inter Universe Math Olympiad: IUMO
"""
if not CONFIG_DIR.exists():
@@ -120,10 +120,7 @@ elif sys.platform.startswith("darwin"):
else:
USER_OS = "linux" # including cygwin
-if (custom_lookup := config.get("lookup")) is not None:
- VON_CUSTOM_LOOKUP = custom_lookup
-else:
- VON_CUSTOM_LOOKUP = {}
+VON_CUSTOM_LOOKUP = config.get("abbreviations", {})
# These used to be editable but I don't think it's worth it
VON_INDEX_NAME = "index"let me know if that looks OK then we can merge this |
Contributor
Author
|
Yeah, this looks good. |
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.
This is in response to a conversation on the OTIS discord about adding a custom lookup table in
rc.py.