Fix changelog last revision identification

This commit is contained in:
Slavfox 2021-06-22 14:15:28 +02:00
parent fb76540c01
commit 4769eda7d0

View file

@ -6,7 +6,8 @@ from unicodedata import name
REPO_ROOT = Path(__file__).parent.parent
COZETTE_SFD = REPO_ROOT / "Cozette" / "Cozette.sfd"
repo = Repo(REPO_ROOT)
last_ver = repo.tags[-1]
last_ver = sorted(repo.tags, key=lambda tag: tag.commit.committed_date)[-1]
last_cozette_sfd: str = (
last_ver
.commit
@ -16,6 +17,7 @@ last_cozette_sfd: str = (
)
char_regex = re.compile(r'BDFChar: (-?\d+) (-?\d+) (-?\d+) (-?\d+) (-?\d+) (-?\d+) (-?\d+)')
def get_codepoints(cozette_sfd: str):
codepoints = {}
current_codepoint = None
@ -27,6 +29,7 @@ def get_codepoints(cozette_sfd: str):
current_codepoint = int(match.group(2))
return codepoints
def print_codepoint(codepoint):
try:
chrname = " " + name(chr(codepoint))
@ -42,6 +45,7 @@ def get_changelog():
with COZETTE_SFD.open() as f:
current_codepoints = get_codepoints(f.read())
print(f"Changelog since {last_ver}: {len(current_codepoints)} glyphs found")
added = set(current_codepoints) - set(previous_codepoints)
removed = set(previous_codepoints) - set(current_codepoints)
changed = set()