Debugging: update subtitle and language representations

This will help making the logs more comprehensible.
pull/2182/head
Vitiko 1 year ago
parent cd016840f9
commit b6777bc26e

@ -76,8 +76,8 @@ class Subtitle(Subtitle_):
self.use_original_format = original_format
def __repr__(self):
return '<%s %r [%s:%s]>' % (
self.__class__.__name__, self.page_link, self.language, self._guessed_encoding)
r_info = str(self.release_info or self.id).replace("\n", " | ").strip()
return f"<{self.__class__.__name__}: {r_info} [{self.language}]>"
@property
def text(self):

@ -112,7 +112,8 @@ class Language(Language_):
bool(self.hi) == bool(other.hi))
def __str__(self):
return super(Language, self).__str__() + (":forced" if self.forced else "")
info = ";".join(f"{k}={v}" for k, v in vars(self).items() if v)
return f"<{self.__class__.__name__}: {info}>"
@property
def basename(self):

Loading…
Cancel
Save