Skip to content

Commit

Permalink
Add some docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseTG committed Apr 11, 2024
1 parent 4e194de commit 0d23b01
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/libretro/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
"""
This module contains types that directly correspond to the libretro API,
All ``retro_`` classes in this package are ctypes wrappers around their equivalents in
`libretro-common <https://github.com/libretro/RetroArch/blob/master/libretro-common/include/libretro.h>`_.
Unless otherwise noted, all structs can be copied with ``copy.deepcopy``;
the struct itself and its fields (including strings and buffers) are all deep-copied.
For example:
.. code-block:: python
import copy
from libretro.api import retro_controller_description
desc = retro_controller_description(b'Game Pad', 5)
desc_copy = copy.deepcopy(desc)
assert desc == desc_copy
desc.desc = b'Another Game Pad'
assert desc != desc_copy
Additionally, all `c_char_p` fields are converted to Python `bytes` objects when accessed.
"""

from .audio import *
from .av import *
from .camera import *
Expand Down
4 changes: 4 additions & 0 deletions src/libretro/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@


class CoreInterface(Protocol):
"""
An interface for a libretro core.
"""

@abstractmethod
def set_environment(self, env: retro_environment_t) -> None: ...

Expand Down
4 changes: 4 additions & 0 deletions src/libretro/driver/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
stuff for drivers
"""

from .audio import *
from .camera import *
from .content import *
Expand Down
4 changes: 4 additions & 0 deletions src/libretro/driver/audio/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
Drivers for handling audio output.
"""

from .driver import *
from .array import *
from .wave import *

0 comments on commit 0d23b01

Please sign in to comment.