Skip to content

Commit e647986

Browse files
committed
fix the docs
1 parent ad4b366 commit e647986

File tree

18 files changed

+143
-71
lines changed

18 files changed

+143
-71
lines changed

coc/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@
7575
TimeDelta,
7676
Label,
7777
WarLeague,
78+
GoldPassSeason,
79+
ChatLanguage
7880
)
81+
from .entry_logs import LogPaginator, ClanWarLog, RaidLog
7982
from .players import Player, ClanMember, RankedPlayer
8083
from .player_clan import PlayerClan
8184
from .spell import Spell
@@ -85,3 +88,4 @@
8588
from .war_members import ClanWarLeagueClanMember, ClanWarMember
8689
from .wars import ClanWar, ClanWarLogEntry, ClanWarLeagueGroup
8790
from . import utils
91+
from .raid import RaidLogEntry, RaidClan, RaidMember, RaidAttack, RaidDistrict

coc/hero.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ class Hero(DataContainer):
5252
village: str
5353
Either ``home`` or ``builderBase``, indicating which village this hero belongs to.
5454
"""
55+
__slots__ = ("id", "name", "range", "dps", "hitpoints", "ground_target", "speed", "upgrade_cost",
56+
"upgrade_time", "ability_time", "required_th_level", "regeneration_time", "level",
57+
"max_level", "village")
5558
name: str
5659
level: int
5760
max_level: int
@@ -140,6 +143,8 @@ class Pet(DataContainer):
140143
village: str
141144
Either ``home`` or ``builderBase``, indicating which village this pet belongs to.
142145
"""
146+
__slots__ = ("id", "name", "range", "dps", "ground_target", "hitpoints", "speed", "upgrade_cost",
147+
"upgrade_resource", "upgrade_time", "level", "max_level", "village")
143148
name: str
144149
level: int
145150
max_level: int

coc/raid.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@
2828
from .miscmodels import Badge, Timestamp, try_enum
2929
from .utils import cached_property, correct_tag
3030

31-
if TYPE_CHECKING:
32-
# pylint: disable=cyclic-import
33-
from .war_members import ClanWarMember # noqa
34-
3531

3632
class RaidMember(BasePlayer):
3733
"""Represents a Raid Member that the API returns.

coc/spell.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ class Spell(DataContainer):
4747
village: str
4848
Either ``home`` or ``builderBase``, indicating which village this spell belongs to.
4949
"""
50+
__slots__ = ("id", "name", "range", "upgrade_cost", "upgrade_resource", "upgrade_time",
51+
"training_cost", "training_resource", "training_time", "is_siege_machine", "level", "max_level",
52+
"village")
5053
name: str
5154
level: int
5255
max_level: int

coc/troop.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ class Troop(DataContainer):
3737
+----------------------------------+-------------------+
3838
| :attr:`Troop.upgrade_resource` | :class:`Resource` |
3939
+----------------------------------+-------------------+
40-
| :attr:`Troop.upgrade_time` | :class:`TimeDelta` |
40+
| :attr:`Troop.upgrade_time` | :class:`TimeDelta`|
4141
+----------------------------------+-------------------+
4242
| :attr:`Troop.training_cost` | int |
4343
+----------------------------------+-------------------+
4444
| :attr:`Troop.training_resource` | :class:`Resource` |
4545
+----------------------------------+-------------------+
46-
| :attr:`Troop.training_time` | :class:`TimeDelta` |
46+
| :attr:`Troop.training_time` |:class:`TimeDelta` |
4747
+----------------------------------+-------------------+
4848
| :attr:`Troop.is_elixir_troop` | :class:`bool` |
4949
+----------------------------------+-------------------+
@@ -53,9 +53,9 @@ class Troop(DataContainer):
5353
+----------------------------------+-------------------+
5454
| :attr:`Troop.is_super_troop` | :class:`bool` |
5555
+----------------------------------+-------------------+
56-
| :attr:`Troop.cooldown` | :class:`TimeDelta` |
56+
| :attr:`Troop.cooldown` | :class:`TimeDelta`|
5757
+----------------------------------+-------------------+
58-
| :attr:`Troop.duration` | :class:`TimeDelta` |
58+
| :attr:`Troop.duration` | :class:`TimeDelta`|
5959
+----------------------------------+-------------------+
6060
| :attr:`Troop.min_original_level` | int |
6161
+----------------------------------+-------------------+
@@ -127,6 +127,9 @@ class Troop(DataContainer):
127127
village: str
128128
Either ``home`` or ``builderBase``, indicating which village this troop belongs to.
129129
"""
130+
__slots__ = ("id", "name", "range", "lab_level", "dps", "hitpoints", "ground_traget", "speed", "upgrade_cost",
131+
"upgrade_resource", "upgrade_time", "training_cost", "training_resource", "training_time",
132+
"cooldown", "duration", "min_original_level", "original_troop", "level", "max_level", "village")
130133
name: str
131134
level: int
132135
max_level: int

docs/code_overview/event.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ A few points to note:
242242
- Tags will be automatically corrected via the :meth:`coc.correct_tag` function.
243243

244244
- **Every tag** that is added to the client will be sent to **every callback for that event group**.
245+
245246
This makes for a much simpler internal design.
246247

247248

docs/code_overview/game_data.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.. currentmodule:: coc
22
.. _game_data:
3+
34
Game Data
45
=========
56
The following provides a detailed how-to for use of static game data that is loaded into coc.py.
@@ -22,6 +23,7 @@ Additionally, speed and memory consumption has been prioritised and optimised wh
2223

2324

2425
.. _initialising_game_data:
26+
2527
Initialising the Client
2628
-----------------------
2729

@@ -82,6 +84,7 @@ Although all efforts have been made to minimise overheads, some may prefer to on
8284
8385
8486
.. _loading_game_data:
87+
8588
Loading Game Data Manually
8689
--------------------------
8790

@@ -125,6 +128,7 @@ won't have metadata loaded. This is easy to fix, with the :meth:`Player.load_gam
125128

126129

127130
.. _initiated_v_uninitiated:
131+
128132
Initiated vs Uninitiated Objects
129133
--------------------------------
130134

@@ -138,6 +142,7 @@ with attributes.
138142

139143

140144
.. _initiated_objects:
145+
141146
Initiated Objects
142147
~~~~~~~~~~~~~~~~~
143148

@@ -197,6 +202,7 @@ Alternatively, you could use :meth:`Client.get_troop` and use the unititiated ob
197202

198203

199204
.. _uninitiated_objects:
205+
200206
Uninitiated Objects
201207
~~~~~~~~~~~~~~~~~~~
202208

docs/code_overview/models.rst

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ Player Clan
2727
:private-members:
2828
:inherited-members:
2929

30+
Raid Clan
31+
^^^^^^^^^
32+
.. autoclass:: RaidClan()
33+
:members:
34+
:private-members:
35+
:inherited-members:
36+
3037
Ranked Clan
3138
^^^^^^^^^^^
3239
.. autoclass:: RankedClan()
@@ -74,7 +81,7 @@ Clan Member
7481
:inherited-members:
7582

7683
Ranked Player
77-
^^^^^^^^^^^
84+
^^^^^^^^^^^^^
7885
.. autoclass:: RankedPlayer()
7986
:members:
8087
:private-members:
@@ -94,6 +101,13 @@ Clan War Member
94101
:private-members:
95102
:inherited-members:
96103

104+
Raid Member
105+
^^^^^^^^^^^
106+
.. autoclass:: RaidMember()
107+
:members:
108+
:private-members:
109+
:inherited-members:
110+
97111
Player
98112
^^^^^^
99113
.. autoclass:: Player()
@@ -135,6 +149,30 @@ WarAttack
135149
:private-members:
136150

137151

152+
Raids
153+
~~~~~~
154+
155+
Raid Log Entry
156+
^^^^^^^^^^^^^^
157+
.. autoclass:: RaidLogEntry()
158+
:members:
159+
:private-members:
160+
:inherited-members:
161+
162+
Raid District
163+
^^^^^^^^^^^^^
164+
.. autoclass:: RaidDistrict()
165+
:members:
166+
:private-members:
167+
:inherited-members:
168+
169+
Raid Attack
170+
~~~~~~~~~~~~
171+
.. autoclass:: RaidAttack()
172+
:members:
173+
:private-members:
174+
175+
138176
Achievement
139177
~~~~~~~~~~~~
140178

@@ -152,23 +190,27 @@ Troop
152190

153191
Hero
154192
~~~~~
155-
156193
.. autoclass:: Hero()
157194
:members:
158195
:private-members:
159196

160197

198+
Pet
199+
~~~~
200+
.. autoclass:: Pet()
201+
:members:
202+
:private-members:
203+
204+
161205
Spell
162206
~~~~~~
163-
164207
.. autoclass:: Spell()
165208
:members:
166209
:private-members:
167210

168211

169212
Location
170213
~~~~~~~~~
171-
172214
.. autoclass:: Location()
173215
:members:
174216
:private-members:
@@ -230,6 +272,13 @@ War League
230272
:members:
231273
:private-members:
232274

275+
Gold pass season
276+
~~~~~~~~~~~~~~~~~
277+
.. autoclass:: GoldPassSeason()
278+
:members:
279+
:private-members:
280+
:inherited-members:
281+
233282
Enumerations
234283
~~~~~~~~~~~~
235284

docs/discord-links/api-reference.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. current-module:: coc
1+
.. currentmodule:: coc
22

33
API Reference
44
=============

docs/discord-links/discord-links-examples.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. current-module:: coc
1+
.. currentmodule:: coc
22

33
Examples
44
========

0 commit comments

Comments
 (0)