hyfetch/hyfetch/distros/__init__.py
2022-12-11 07:40:53 -05:00

20 lines
510 B
Python

from __future__ import annotations
import string
class AsciiArt:
name: str
match: str
color: str
ascii: str
def __init__(self, match: str, color: str, ascii: str, name: str | None = None):
self.match = match
self.color = color
self.ascii = ascii
self.name = name or self.get_friendly_name()
def get_friendly_name(self) -> str:
return self.match.split("|")[0].strip(string.punctuation + '* ') \
.replace('"', '').replace('*', '')