Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions von/puid.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import hashlib
import re

from rc import VON_CUSTOM_LOOKUP

lookup = {
"Afghanistan": "AFG",
"Albania": "ALB",
Expand Down Expand Up @@ -207,6 +209,7 @@
lookup["USAMTS"] = "USMT"
lookup["USA GST"] = "USAEST"

lookup.update(VON_CUSTOM_LOOKUP)
# whooooo
REGEX = r"(?P<contest>[a-zA-Z][a-zA-Z0-9 ]+)(19|20)(?P<year>[0-9][0-9])(?P<stem>[ \/](?P<locator>[0-9A-Za-z\.\/\- ]+))?$"
re_generic = re.compile(REGEX)
Expand Down
12 changes: 11 additions & 1 deletion von/rc.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,15 @@

# Name of text editor to invoke
# By default, it detects from $EDITOR automatically
# editor: vim"""
# 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`.
# abbreviations:
# Inter Galaxy Math Olympiad: IGMO
# Inter Universe Math Olympiad: IUMO
"""

if not CONFIG_DIR.exists():
try:
Expand Down Expand Up @@ -112,6 +120,8 @@
else:
USER_OS = "linux" # including cygwin

VON_CUSTOM_LOOKUP = config.get("abbreviations", {})

# These used to be editable but I don't think it's worth it
VON_INDEX_NAME = "index"
VON_INDEX_PATH = os.path.join(VON_BASE_PATH, VON_INDEX_NAME)
Expand Down