compuglobal 0.4.1__tar.gz → 0.4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {compuglobal-0.4.1 → compuglobal-0.4.2}/PKG-INFO +1 -1
- {compuglobal-0.4.1 → compuglobal-0.4.2}/compuglobal/__init__.py +1 -1
- {compuglobal-0.4.1 → compuglobal-0.4.2}/compuglobal/models/overlay.py +11 -29
- {compuglobal-0.4.1 → compuglobal-0.4.2}/LICENSE +0 -0
- {compuglobal-0.4.1 → compuglobal-0.4.2}/README.rst +0 -0
- {compuglobal-0.4.1 → compuglobal-0.4.2}/compuglobal/aio.py +0 -0
- {compuglobal-0.4.1 → compuglobal-0.4.2}/compuglobal/api/__init__.py +0 -0
- {compuglobal-0.4.1 → compuglobal-0.4.2}/compuglobal/api/client.py +0 -0
- {compuglobal-0.4.1 → compuglobal-0.4.2}/compuglobal/api/config.py +0 -0
- {compuglobal-0.4.1 → compuglobal-0.4.2}/compuglobal/api/discovery.py +0 -0
- {compuglobal-0.4.1 → compuglobal-0.4.2}/compuglobal/api/endpoint.py +0 -0
- {compuglobal-0.4.1 → compuglobal-0.4.2}/compuglobal/api/media.py +0 -0
- {compuglobal-0.4.1 → compuglobal-0.4.2}/compuglobal/api/metadata.py +0 -0
- {compuglobal-0.4.1 → compuglobal-0.4.2}/compuglobal/errors.py +0 -0
- {compuglobal-0.4.1 → compuglobal-0.4.2}/compuglobal/models/__init__.py +0 -0
- {compuglobal-0.4.1 → compuglobal-0.4.2}/compuglobal/models/base.py +0 -0
- {compuglobal-0.4.1 → compuglobal-0.4.2}/compuglobal/models/comic.py +0 -0
- {compuglobal-0.4.1 → compuglobal-0.4.2}/compuglobal/models/episode.py +0 -0
- {compuglobal-0.4.1 → compuglobal-0.4.2}/compuglobal/models/font.py +0 -0
- {compuglobal-0.4.1 → compuglobal-0.4.2}/compuglobal/models/frame.py +0 -0
- {compuglobal-0.4.1 → compuglobal-0.4.2}/compuglobal/models/screencap.py +0 -0
- {compuglobal-0.4.1 → compuglobal-0.4.2}/compuglobal/models/stream.py +0 -0
- {compuglobal-0.4.1 → compuglobal-0.4.2}/compuglobal/models/subtitle.py +0 -0
- {compuglobal-0.4.1 → compuglobal-0.4.2}/compuglobal/models/timestamp.py +0 -0
- {compuglobal-0.4.1 → compuglobal-0.4.2}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: compuglobal
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
4
4
|
Summary: Python wrapper for the CGHMC API (Frinkiac, Morbotron Master Of All Science and more.
|
|
5
5
|
Keywords: The Simpsons,Futurama,Rick and Morty,West Wing,Frinkiac,Morbotron,Master of all Science,Capital Beat,API,API Wrapper,CompuGlobal,CompuGlobalHyperMegaNet,CGHMC
|
|
6
6
|
Author: MitchellAW
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"""Helper class for formatting of StreamOverlays and ComicOverlays."""
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
from dataclasses import dataclass, field
|
|
3
|
+
from pydantic import Field
|
|
5
4
|
|
|
5
|
+
from compuglobal.models.base import BaseCompuGlobalModel
|
|
6
6
|
from compuglobal.models.font import FontAlignment, FontColor, FontFamily
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
class OverlayFormat:
|
|
9
|
+
class OverlayFormat(BaseCompuGlobalModel):
|
|
11
10
|
"""The formatting style to use in an overlay.
|
|
12
11
|
|
|
13
12
|
Attributes
|
|
@@ -29,33 +28,16 @@ class OverlayFormat:
|
|
|
29
28
|
|
|
30
29
|
"""
|
|
31
30
|
|
|
32
|
-
font_family: FontFamily = FontFamily.IMPACT
|
|
33
|
-
font_size: int = 0
|
|
34
|
-
font_color: FontColor =
|
|
35
|
-
text_position_x: int = 50
|
|
36
|
-
text_position_y: int = 97
|
|
37
|
-
text_alignment: FontAlignment = FontAlignment.ALIGN_CENTER
|
|
38
|
-
all_caps: bool = True
|
|
39
|
-
|
|
40
|
-
def __post_init__(self) -> None:
|
|
41
|
-
"""Validate font size.
|
|
42
|
-
|
|
43
|
-
Raises
|
|
44
|
-
------
|
|
45
|
-
ValueError
|
|
46
|
-
Font size must be between 0-120
|
|
47
|
-
|
|
48
|
-
"""
|
|
49
|
-
max_font_size = 120
|
|
50
|
-
if self.font_size < 0 or self.font_size > max_font_size:
|
|
51
|
-
msg = f"Font size must be between 0 and {max_font_size}, but got {self.font_size}"
|
|
52
|
-
raise ValueError(msg)
|
|
53
|
-
|
|
54
|
-
def _changed_fields(self) -> dict:
|
|
55
|
-
return {f.name: getattr(self, f.name) for f in dataclasses.fields(self) if getattr(self, f.name) != f.default}
|
|
31
|
+
font_family: FontFamily = Field(default=FontFamily.IMPACT)
|
|
32
|
+
font_size: int = Field(ge=0, le=120, default=0)
|
|
33
|
+
font_color: FontColor = Field(default=FontColor())
|
|
34
|
+
text_position_x: int = Field(default=50)
|
|
35
|
+
text_position_y: int = Field(default=97)
|
|
36
|
+
text_alignment: FontAlignment = Field(default=FontAlignment.ALIGN_CENTER)
|
|
37
|
+
all_caps: bool = Field(default=True)
|
|
56
38
|
|
|
57
39
|
def __str__(self) -> str: # noqa: D105
|
|
58
|
-
return str(self.
|
|
40
|
+
return str(self.model_dump(exclude_defaults=True))
|
|
59
41
|
|
|
60
42
|
@property
|
|
61
43
|
def font_color_hex(self) -> str:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|