Skip to content

Commit

Permalink
Split group up
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncozens committed Sep 16, 2024
1 parent d547bc3 commit 066d8db
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions Lib/shaperglot/cli/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,31 +71,33 @@ def report(options) -> None:
return

if options.group:
if supported:
print("Supported languages")
print("===================\n")
for lang in supported:
print(f"Font supports language '{lang}' ({langs[lang]['name']})")

if nearly:
print("\nNearly supported languages")
print("===================\n")
for lang in nearly:
print(f"Font nearly supports language '{lang}' ({langs[lang]['name']})")

if unsupported:
print("\nUnsupported languages")
print("====================\n")
for lang in unsupported:
print(
f"Font does not fully support language '{lang}' ({langs[lang]['name']})"
)
show_grouped(langs, nearly, supported, unsupported)
# Collate a useful fixing guide
short_summary(supported, nearly, unsupported)
if options.verbose:
long_summary(fixes_needed, unsupported)


def show_grouped(langs, nearly, supported, unsupported):
if supported:
print("Supported languages")
print("===================\n")
for lang in supported:
print(f"Font supports language '{lang}' ({langs[lang]['name']})")

if nearly:
print("\nNearly supported languages")
print("===================\n")
for lang in nearly:
print(f"Font nearly supports language '{lang}' ({langs[lang]['name']})")

if unsupported:
print("\nUnsupported languages")
print("====================\n")
for lang in unsupported:
print(f"Font does not fully support language '{lang}' ({langs[lang]['name']})")


def short_summary(supported, nearly, unsupported) -> None:
print("\n== Summary ==\n")
print(f"* {len(supported)+len(nearly)+len(unsupported)} languages checked")
Expand Down

0 comments on commit 066d8db

Please sign in to comment.