FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

make namedtuples documented · stoatchat/python-client-sdk@7ba69af · GitHub

Commit 7ba69af

Browse files
committed
make namedtuples documented
1 parent 3a7e7b3 commit 7ba69af

5 files changed

Lines changed: 26 additions & 17 deletions

File tree

‎docs/api.rst‎

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,26 @@ DMChannel
3535
:members:
3636

3737
GroupDMChannel
38-
~~~~~~~~~~
38+
~~~~~~~~~~~~~~~
3939

4040
.. autoclass:: GroupDMChannel
4141
:members:
4242

4343
TextChannel
44-
~~~~~~~~~~
44+
~~~~~~~~~~~~
4545

4646
.. autoclass:: TextChannel
4747
:members:
4848

4949
VoiceChannel
50-
~~~~~~~~~~
50+
~~~~~~~~~~~~
5151

5252
.. autoclass:: VoiceChannel
5353
:members:
5454

5555

5656
Embed
57-
~~~~~~~~~~
57+
~~~~~~
5858

5959
.. autoclass:: Embed
6060
:members:
@@ -108,8 +108,20 @@ User
108108
.. autoclass:: User
109109
:members:
110110

111+
Relation
112+
~~~~~~~~~
113+
114+
.. autonamedtuple:: Relation
115+
116+
117+
Status
118+
~~~~~~~
119+
120+
.. autonamedtuple:: Status
121+
122+
111123
Enums
112-
------
124+
======
113125

114126
The api uses enums to say what variant of something is, these represent those enums
115127

‎docs/conf.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
extensions = [
3333
"sphinx.ext.napoleon",
3434
"sphinx.ext.autodoc",
35+
"sphinx_toolbox.installation",
36+
"sphinx_toolbox.more_autodoc.autonamedtuple"
3537
]
3638

3739
# Add any paths that contain templates here, relative to this directory.
@@ -42,6 +44,7 @@
4244
# This pattern also affects html_static_path and html_extra_path.
4345
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
4446

47+
add_module_names = False
4548

4649
# -- Options for HTML output -------------------------------------------------
4750

‎docs_requirements.txt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
Sphinx==4.1.2
1+
Sphinx==3.5.4
22
sphinx-nameko-theme==0.0.3
33
aiohttp==3.7.4.post0
44
ulid-py==1.1.0
5+
sphinx-toolbox==2.13.0

‎revolt/__init__.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from .asset import Asset
2-
from .channel import DMChannel, Channel, GroupDMChannel, SavedMessageChannel, VoiceChannel
2+
from .channel import DMChannel, Channel, GroupDMChannel, SavedMessageChannel, VoiceChannel, TextChannel
33
from .client import Client
44
from .embed import Embed
55
from .errors import HTTPError, RevoltError, ServerError
@@ -10,6 +10,6 @@
1010
from .permissions import Permissions
1111
from .role import Role
1212
from .server import Server
13-
from .user import User
13+
from .user import User, Status, Relation
1414

1515
__version__ = (0, 0, 1)

‎revolt/user.py‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,12 @@
1010
from .types import User as UserPayload, UserRelation
1111

1212
class Relation(NamedTuple):
13-
"""A namedtuple representing a relation between the bot and a user
14-
15-
Attributes
16-
-----------
17-
type: :class:`RelationshipType`
18-
The type of relationship
19-
user: :class:`User`
20-
The user the relationship is for
21-
"""
13+
"""A namedtuple representing a relation between the bot and a user"""
2214
type: RelationshipType
2315
user: User
2416

2517
class Status(NamedTuple):
18+
"""A namedtuple representing a users status"""
2619
text: Optional[str]
2720
presence: Optional[PresenceType]
2821

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL