make namedtuples documented

This commit is contained in:
Zomatree
2021-08-30 17:11:30 +01:00
parent 3a7e7b3a00
commit 7ba69af3b8
5 changed files with 26 additions and 17 deletions
+17 -5
View File
@@ -35,26 +35,26 @@ DMChannel
:members:
GroupDMChannel
~~~~~~~~~~
~~~~~~~~~~~~~~~
.. autoclass:: GroupDMChannel
:members:
TextChannel
~~~~~~~~~~
~~~~~~~~~~~~
.. autoclass:: TextChannel
:members:
VoiceChannel
~~~~~~~~~~
~~~~~~~~~~~~
.. autoclass:: VoiceChannel
:members:
Embed
~~~~~~~~~~
~~~~~~
.. autoclass:: Embed
:members:
@@ -108,8 +108,20 @@ User
.. autoclass:: User
:members:
Relation
~~~~~~~~~
.. autonamedtuple:: Relation
Status
~~~~~~~
.. autonamedtuple:: Status
Enums
------
======
The api uses enums to say what variant of something is, these represent those enums
+3
View File
@@ -32,6 +32,8 @@ version = "0.0.1"
extensions = [
"sphinx.ext.napoleon",
"sphinx.ext.autodoc",
"sphinx_toolbox.installation",
"sphinx_toolbox.more_autodoc.autonamedtuple"
]
# Add any paths that contain templates here, relative to this directory.
@@ -42,6 +44,7 @@ templates_path = ['_templates']
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
add_module_names = False
# -- Options for HTML output -------------------------------------------------
+2 -1
View File
@@ -1,4 +1,5 @@
Sphinx==4.1.2
Sphinx==3.5.4
sphinx-nameko-theme==0.0.3
aiohttp==3.7.4.post0
ulid-py==1.1.0
sphinx-toolbox==2.13.0
+2 -2
View File
@@ -1,5 +1,5 @@
from .asset import Asset
from .channel import DMChannel, Channel, GroupDMChannel, SavedMessageChannel, VoiceChannel
from .channel import DMChannel, Channel, GroupDMChannel, SavedMessageChannel, VoiceChannel, TextChannel
from .client import Client
from .embed import Embed
from .errors import HTTPError, RevoltError, ServerError
@@ -10,6 +10,6 @@ from .messageable import Messageable
from .permissions import Permissions
from .role import Role
from .server import Server
from .user import User
from .user import User, Status, Relation
__version__ = (0, 0, 1)
+2 -9
View File
@@ -10,19 +10,12 @@ if TYPE_CHECKING:
from .types import User as UserPayload, UserRelation
class Relation(NamedTuple):
"""A namedtuple representing a relation between the bot and a user
Attributes
-----------
type: :class:`RelationshipType`
The type of relationship
user: :class:`User`
The user the relationship is for
"""
"""A namedtuple representing a relation between the bot and a user"""
type: RelationshipType
user: User
class Status(NamedTuple):
"""A namedtuple representing a users status"""
text: Optional[str]
presence: Optional[PresenceType]