Skip to content

Commit 54f2b24

Browse files
authored
Fix realtime kwargs (#258)
* Don't pass realtime twice * Update version to 3.8.3 Bumped the library version to 3.8.3 in multiple file. Updated the changelog to document this fix.
1 parent f36b4b5 commit 54f2b24

File tree

5 files changed

+14
-24
lines changed

5 files changed

+14
-24
lines changed

coc/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
SOFTWARE.
2323
"""
2424

25-
__version__ = "3.8.2"
25+
__version__ = "3.8.3"
2626

2727
from .abc import BasePlayer, BaseClan
2828
from .clans import RankedClan, Clan

coc/client.py

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ def _defaults(self):
280280
"lookup_cache": self.lookup_cache,
281281
"update_cache": self.update_cache,
282282
"ignore_cached_errors": self.ignore_cached_errors,
283+
"realtime": self.realtime,
283284
}
284285

285286
async def __aenter__(self):
@@ -957,15 +958,7 @@ async def get_clan_war(self, clan_tag: str, cls: Type[ClanWar] = None, **kwargs)
957958
clan_tag = correct_tag(clan_tag)
958959

959960
try:
960-
realtime = kwargs.get("realtime")
961-
except KeyError:
962-
realtime = None
963-
964-
try:
965-
data = await self.http.get_clan_current_war(clan_tag, realtime=realtime,
966-
lookup_cache=kwargs.get("lookup_cache", self.lookup_cache),
967-
update_cache=kwargs.get("update_cache", self.update_cache),
968-
ignore_cached_errors=kwargs.get("ignore_cached_errors", self.ignore_cached_errors))
961+
data = await self.http.get_clan_current_war(clan_tag, **{**self._defaults, **kwargs})
969962
except Forbidden as exception:
970963
raise PrivateWarLog(exception.response, exception.reason) from exception
971964

@@ -1082,12 +1075,7 @@ async def get_league_group(
10821075
clan_tag = correct_tag(clan_tag)
10831076

10841077
try:
1085-
realtime = kwargs.get("realtime")
1086-
except KeyError:
1087-
realtime = None
1088-
1089-
try:
1090-
data = await self.http.get_clan_war_league_group(clan_tag, realtime=realtime, **{**self._defaults, **kwargs})
1078+
data = await self.http.get_clan_war_league_group(clan_tag, **{**self._defaults, **kwargs})
10911079
except Forbidden as exception:
10921080
raise PrivateWarLog(exception.response, exception.reason) from exception
10931081
except asyncio.TimeoutError:
@@ -1140,12 +1128,7 @@ async def get_league_war(self, war_tag: str, cls: Type[ClanWar] = None, **kwargs
11401128
war_tag = correct_tag(war_tag)
11411129

11421130
try:
1143-
realtime = kwargs.get("realtime")
1144-
except KeyError:
1145-
realtime = None
1146-
1147-
try:
1148-
data = await self.http.get_cwl_wars(war_tag, realtime=realtime, **{**self._defaults, **kwargs})
1131+
data = await self.http.get_cwl_wars(war_tag, **{**self._defaults, **kwargs})
11491132
except Forbidden as exception:
11501133
raise PrivateWarLog(exception.response, exception.reason) from exception
11511134

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
project = 'coc'
1616
copyright = '2022, mathsman5133'
1717
author = 'mathsman5133'
18-
release = '3.8.2'
18+
release = '3.8.3'
1919

2020

2121
# -- General configuration ---------------------------------------------------

docs/miscellaneous/changelog.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ Changelog
77
This page keeps a fairly detailed, human readable version
88
of what has changed, and whats new for each version of the lib.
99

10+
v3.8.3
11+
------
12+
13+
Bugs Fixed:
14+
~~~~~~~~~~~
15+
- Fixed a bug in serveral war related endpoints that passed realtime twice to the http client.
16+
1017
v3.8.2
1118
------
1219

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "coc.py"
77
authors = [{ name = "mathsman5133" }]
88
maintainers = [{ name = "majordoobie" }, { name = "MagicTheDev" }, { name = "Kuchenmampfer" },
99
{ name = "lukasthaler"}, { name = "doluk"}]
10-
version = "3.8.2"
10+
version = "3.8.3"
1111
description = "A python wrapper for the Clash of Clans API"
1212
requires-python = ">=3.7.3"
1313
readme = "README.rst"

0 commit comments

Comments
 (0)