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

@ -112,7 +112,8 @@ class Language(Language_):
bool(self.hi) == bool(other.hi)) bool(self.hi) == bool(other.hi))
def __str__(self): 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 @property
def basename(self): def basename(self):

Loading…
Cancel
Save