Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 40 additions & 19 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"version": "2.0.0",
"tasks": [
{
// Source: https://github.com/astral-sh/ruff-vscode/issues/145#issuecomment-4187903472
"label": "ruff check",
"type": "shell",
"isBackground": true,
Expand Down Expand Up @@ -41,14 +40,14 @@
}
]
}
],
]
},
{
"label": "pyrefly check",
"type": "shell",
"isBackground": true,
"presentation": {
"reveal": "always",
"reveal": "always"
},
"command": "uvx",
"args": [
Expand All @@ -75,24 +74,46 @@
"reveal": "never"
},
"problemMatcher": {
"fileLocation": ["relative", "${workspaceFolder}"],
"owner": "pydoclint",
"severity": "warning",
"pattern": [
{
"regexp": "^(\\S.*\\.py)$",
"file": 1
"fileLocation": [
"relative",
"${workspaceFolder}"
],
"owner": "pydoclint",
"severity": "warning",
"pattern": [
{
"regexp": "^(\\S.*\\.py)$",
"file": 1
},
{
"regexp": "^\\s+(\\d+):\\s+(DOC\\d+):\\s+(.*)$",
"line": 1,
"code": 2,
"message": 3,
"loop": true
}
]
},
"type": "shell"
},
{
"regexp": "^\\s+(\\d+):\\s+(DOC\\d+):\\s+(.*)$",
"line": 1,
"code": 2,
"message": 3,
"loop": true
}
]
},
"type": "shell"
"label": "sphinx-autobuild",
"command": "uv",
"args": [
"run",
"sphinx-autobuild",
"docs/",
"docs/_build/html",
"--open-browser"
],
"type": "shell",
"presentation": {
"echo": true,
"reveal": "never",
"focus": false,
"panel": "shared"
},
"problemMatcher": []
}
]
}
2 changes: 1 addition & 1 deletion compuglobal/aio.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ async def discover(self) -> list[ScreencapMoment]:
Returns
-------
list[ScreencapMoment]
List of random ``ScreencapMoment``s
List of random screencap moments

"""
request = self.discovery.DISCOVER.build_request(self.client.base_url)
Expand Down
20 changes: 18 additions & 2 deletions compuglobal/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@


class BaseCompuGlobalModel(BaseModel, frozen=True):
"""Base model class used for all API models."""
"""Base model class used for all API models.

model_config = ConfigDict(extra="forbid", validate_by_name=True, validate_by_alias=True, serialize_by_alias=True)
.. code-block:: python

model_config = ConfigDict(
extra="forbid",
frozen=True,
serialize_by_alias=True,
validate_by_alias=True,
validate_by_name=True,
)
"""

model_config = ConfigDict(
extra="forbid",
validate_by_name=True,
validate_by_alias=True,
serialize_by_alias=True,
)
4 changes: 4 additions & 0 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

dt.sig {
background-color: color-mix(in srgb, var(--sy-c-surface) 85%, var(--sy-c-divider));
}
15 changes: 12 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinxcontrib_trio",
"sphinx_rtd_theme",
"sphinxcontrib.pydantic",
"sphinx_copybutton",
]

autodoc_member_order = "bysource"
Expand All @@ -43,10 +44,18 @@
templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

sphinxcontrib_pydantic_field_show_alias = False
sphinxcontrib_pydantic_model_show_field_summary = False
sphinxcontrib_pydantic_model_show_validator_summary = False
sphinxcontrib_pydantic_field_show_constraints = False

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "sphinx_rtd_theme"
html_theme_options = {"navigation_depth": 3}
html_theme = "shibuya"
html_theme_options = {
"accent_color": "indigo",
"github_url": "https://github.com/MitchellAW/CompuGlobal",
}
html_static_path = ["_static"]
html_css_files = ["custom.css"]
4 changes: 2 additions & 2 deletions docs/errors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ Errors
===================

APIPageStatusError
~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~
.. autoclass:: APIPageStatusError
:members:


NoSearchResultsFoundError
~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: NoSearchResultsFoundError
:members:
26 changes: 6 additions & 20 deletions docs/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,87 +3,72 @@
Models
===================

Frame
Frames
~~~~~~~~~~~~~~~~~~~~
.. autoclass:: Frame
:members:
:exclude-members: model_config

.. autoclass:: FrameResult
:members:
:show-inheritance:
:exclude-members: model_config

Screencap
Screencaps
~~~~~~~~~~~~~~~~~~~~
.. autoclass:: Screencap
:members:
:exclude-members: model_config

.. autoclass:: ScreencapMoment
:members:
:exclude-members: model_config

Episode
Episodes
~~~~~~~~~~~~~~~~~~~~
.. autoclass:: EpisodeMetadata
:members:
:exclude-members: model_config

.. autoclass:: EpisodeSummary
:members:
:exclude-members: model_config

.. autoclass:: Episode
:members:
:exclude-members: model_config

Subtitle
Subtitles
~~~~~~~~~~~~~~~~~~~~
.. autoclass:: Subtitle
:members:
:exclude-members: model_config

Overlays
~~~~~~~~~~~~~~~~~~~~
.. autoclass:: OverlayFormat
:members:
:exclude-members: model_config

.. _comics:

Comics
~~~~~~~~~~~~~~~~~~~~
.. autoclass:: ComicPanel
:members:
:exclude-members: model_config

.. autoclass:: ComicStrip
:members:
:exclude-members: model_config

.. autoclass:: ComicOverlay
:members:
:exclude-members: model_config

.. autoclass:: ComicLayout
:members:

Stream
Streams
~~~~~~~~~~~~~~~~~~~~
.. autoclass:: Stream
:members:
:exclude-members: model_config

.. autoclass:: StreamOverlay
:members:
:exclude-members: model_config

Fonts
~~~~~~~~~~~~~~~~~~~~
.. autoclass:: FontColorRGB
:members:
:exclude-members: model_config

.. autoclass:: FontAlignment
:members:
Expand All @@ -96,4 +81,5 @@ Fonts

.. autoclass:: compuglobal.models.base.BaseCompuGlobalModel
:members:
:exclude-members: model_config
:no-index:
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ dev = [
"ruff>=0.15.13",
]
docs = [
"shibuya>=2026.5.19",
"sphinx>=9.1.0",
"sphinx-rtd-theme>=3.1.0",
"sphinx-autobuild>=2025.8.25",
"sphinx-copybutton>=0.5.2",
"sphinxcontrib-pydantic>=0.3.0",
"sphinxcontrib-trio>=1.2.0",
]
test = [
Expand Down
Loading
Loading