Skip to content

Commit d426c1a

Browse files
committed
clean up of mysterious commits
1 parent 205a017 commit d426c1a

File tree

6 files changed

+7
-17
lines changed

6 files changed

+7
-17
lines changed

coc/abc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ def share_link(self) -> str:
152152
class DataContainerMetaClass(type):
153153
def __repr__(cls):
154154
attrs = [
155-
("name", cls.name if 'name' in cls.__dict__ else "not initialized"),
156-
("id", cls.id if 'id' in cls.__dict__ else "not initialized"),
155+
("name", cls.name),
156+
("id", cls.id),
157157
]
158158
return "<%s %s>" % (cls.__name__, " ".join("%s=%r" % t for t in attrs),)
159159

coc/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ async def login(self, email: str, password: str) -> None:
273273
self._create_holders()
274274
LOG.debug("HTTP connection created. Client is ready for use.")
275275

276-
async def login_with_keys(self, *keys: str) -> None:
276+
def login_with_keys(self, *keys: str) -> None:
277277
"""Retrieves all keys and creates an HTTP connection ready for use.
278278
279279
Parameters
@@ -284,7 +284,7 @@ async def login_with_keys(self, *keys: str) -> None:
284284
http._keys = keys
285285
http.keys = cycle(http._keys)
286286
http.key_count = len(keys)
287-
await http.create_session(self.connector, self.timeout)
287+
self.loop.run_until_complete(http.create_session(self.connector, self.timeout))
288288
self._create_holders()
289289

290290
LOG.debug("HTTP connection created. Client is ready for use.")

coc/events.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ class WarEvents:
131131
@classmethod
132132
def state(cls, tags: Iterable = None, custom_class: Type[ClanWar] = ClanWar, retry_interval: int = None) -> _EventDecoratorReturn: ...
133133
@classmethod
134-
def preparation_start_time(cls, tags: Iterable = None, custom_class: Type[ClanWar] = ClanWar, retry_interval: int = None) -> _EventDecoratorReturn: ...
135-
@classmethod
136134
def members(cls, tags: Iterable = None, custom_class: Type[ClanWar] = ClanWar, retry_interval: int = None) -> _EventDecoratorReturn: ...
137135

138136
class ClientEvents:

coc/login.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,5 @@ def login_with_keys(*keys: str, client: Type[Union[Client, EventsClient]] = Clie
7878
Any kwargs you wish to pass into the Client object.
7979
"""
8080
instance = client(**kwargs)
81-
instance.loop.run_until_complete(instance.login_with_keys(*keys))
81+
instance.login_with_keys(*keys)
8282
return instance

coc/wars.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,12 @@ class ClanWar:
8282
"league_group",
8383
"attacks_per_member",
8484
"_response_retry",
85-
"_raw_data"
8685
)
8786

8887
def __init__(self, *, data, client, **kwargs):
8988
self._response_retry = data.get("_response_retry")
9089
self._client = client
91-
self._raw_data = data
90+
9291
self.clan_tag = kwargs.pop("clan_tag", None)
9392
self._from_data(data)
9493

docs/code_overview/client.rst

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,9 @@ Example
1616
~~~~~~~
1717
.. code-block:: python3
1818
19-
import asyncio
2019
import coc
2120
22-
async def main():
23-
async with coc.Client() as coc_client:
24-
await coc_client.login("email", "password")
25-
26-
# do stuff
27-
28-
asyncio.run(main())
21+
client = coc.login("email", "password", key_names="keys for my windows pc", key_count=5)
2922
3023
With the returned instance, you can complete any of the operations detailed below.
3124

0 commit comments

Comments
 (0)