mirror of https://github.com/devine-dl/devine.git
style: Move __...__ methods after constructors
This commit is contained in:
parent
23485bc820
commit
642ad393b6
|
@ -76,6 +76,17 @@ class Audio(Track):
|
|||
self.joc = joc
|
||||
self.descriptive = bool(descriptive)
|
||||
|
||||
def __str__(self) -> str:
|
||||
return " | ".join(filter(bool, [
|
||||
"AUD",
|
||||
f"[{self.codec.value}]",
|
||||
str(self.channels or "?") + (f" (JOC {self.joc})" if self.joc else ""),
|
||||
f"{self.bitrate // 1000 if self.bitrate else '?'} kb/s",
|
||||
str(self.language),
|
||||
self.get_track_name(),
|
||||
self.edition
|
||||
]))
|
||||
|
||||
@staticmethod
|
||||
def parse_channels(channels: Union[str, int, float]) -> float:
|
||||
"""
|
||||
|
@ -109,16 +120,5 @@ class Audio(Track):
|
|||
track_name += flag
|
||||
return track_name or None
|
||||
|
||||
def __str__(self) -> str:
|
||||
return " | ".join(filter(bool, [
|
||||
"AUD",
|
||||
f"[{self.codec.value}]",
|
||||
str(self.channels or "?") + (f" (JOC {self.joc})" if self.joc else ""),
|
||||
f"{self.bitrate // 1000 if self.bitrate else '?'} kb/s",
|
||||
str(self.language),
|
||||
self.get_track_name(),
|
||||
self.edition
|
||||
]))
|
||||
|
||||
|
||||
__all__ = ("Audio",)
|
||||
|
|
|
@ -139,6 +139,14 @@ class Subtitle(Track):
|
|||
# Called after Track has been converted to another format
|
||||
self.OnConverted: Optional[Callable[[Subtitle.Codec], None]] = None
|
||||
|
||||
def __str__(self) -> str:
|
||||
return " | ".join(filter(bool, [
|
||||
"SUB",
|
||||
f"[{self.codec.value}]",
|
||||
str(self.language),
|
||||
self.get_track_name()
|
||||
]))
|
||||
|
||||
def get_track_name(self) -> Optional[str]:
|
||||
"""Return the base Track Name."""
|
||||
track_name = super().get_track_name() or ""
|
||||
|
@ -525,13 +533,5 @@ class Subtitle(Track):
|
|||
stdout=subprocess.DEVNULL
|
||||
)
|
||||
|
||||
def __str__(self) -> str:
|
||||
return " | ".join(filter(bool, [
|
||||
"SUB",
|
||||
f"[{self.codec.value}]",
|
||||
str(self.language),
|
||||
self.get_track_name()
|
||||
]))
|
||||
|
||||
|
||||
__all__ = ("Subtitle",)
|
||||
|
|
Loading…
Reference in New Issue