distro.py 571 B

12345678910111213141516171819202122232425
  1. from __future__ import annotations
  2. import string
  3. asciis: list['AsciiArt'] = []
  4. class AsciiArt:
  5. name: str
  6. match: str
  7. color: str
  8. ascii: str
  9. def __init__(self, match: str, color: str, ascii: str, name: str | None = None):
  10. self.match = match
  11. self.color = color
  12. self.ascii = ascii
  13. self.name = name or self.get_friendly_name()
  14. asciis.append(self)
  15. def get_friendly_name(self) -> str:
  16. return self.match.split("|")[0].strip(string.punctuation + '* ') \
  17. .replace('"', '').replace('*', '')