Skip to content

Commit 818c05c

Browse files
authored
Fix Client.wait_for (#222)
* Replace if statement with if expression * Simplify conditional into return statement * Inline variable that is immediately returned * Comparison moved to the right Use set when checking membership of a collection of literals * Inline variable that is immediately returned * remove none from dict.get returns none by default * Replace if statement with if expression Replace multiple comparisons of same variable with `in` operator Remove redundant conditional * Merge nested if conditions Remove none from dict.get returns none by default * Lift code into else after jump in control flow, Merge else clause's nested if statement into elif Remove redundant pass statements Simplify logical expression * Inline variable that is immediately returned * Merge nested if conditions Inline variable that is immediately returned * Merge nested if conditions * Swap if/else branches, Remove unnecessary else after guard condition * Replace unneeded comprehension with generator * added fetch_channel to client * formatting * remove typehint of User * Added fetch_follow method Removed for loop for fetch_channel * Update README.rst Added myself....just because * fix remove_cog * Fixed remove_cog * changed from list to set * Moved fetch_follow to user from client Fixed black formatting to 120 * Added ChannelInfo class in models Changed fetch_channel to return the ChannelInfo object * Removed except from remove_cog Issue was in unload_module Missing .items() for callsbacks Missing .__name__ for comparison * fixed reload_module * added created_at to User class * Routine fix where after task run completion iterations would set to 0 and run infinitely. * Add typehint for PartialUser in fetch_follow * Removed duplicate fetch_channel Updated docstring fetch_channel * Changed badges to a property returns a dict * change to more obvious wording * fetch duplicate fetch_channel update docstring * added founder to is_subscriber * Update websocket to fix chatters Correct some typos Update badges docstring Fix eventsub BanData key * reverted changes to ChannelBanData model * changed payload key to is_permanent for ChannelBanData * Added Schedule models Added user method fetch_schedule Added associated API calls Added explicit detail in fetch_channel docstring * forgot to merge * Revert "changed payload key to is_permanent for ChannelBanData" This reverts commit ba16c04. * Revert "forgot to merge" This reverts commit 7b16588. * Revert "Added Schedule models" This reverts commit ea6f7bf. * trying to fix my own repo * add * Added Schedule models Added user method fetch_schedule Added associated API calls Added explicit detail in fetch_channel docstring * added back in newlines from formatting * change to list comp * black formatting * change raise to ValueError and move above comp * changed segment_ids to list * update docstring * update docstring * Changed start_time to datetime object Internal conversion to RFC3339 Changed utc_offset to int and convert to str later * adding modify stream to match master * adding back in schedule * merge * Fix for wait_for not removing Finshed future from self._waiting
1 parent dbf0a73 commit 818c05c

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

twitchio/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ async def wrapped(func):
216216
if e == event_name:
217217
if check(*args):
218218
future.set_result(args)
219+
if future.done():
220+
self._waiting.remove((e, check, future))
219221

220222
def add_event(self, callback: Callable, name: str = None) -> None:
221223
try:

twitchio/models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,6 @@ def colour(self) -> str:
662662
def __repr__(self):
663663
return f"<PredictionOutcome outcome_id={self.outcome_id} title={self.title} channel_points={self.channel_points} color={self.color}>"
664664

665-
666665
class Schedule:
667666

668667
__slots__ = ("segments", "user", "vacation")

twitchio/user.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,6 @@ async def modify_stream(self, token: str, game_id: int = None, language: str = N
728728
"""|coro|
729729
730730
Modify stream information
731-
732731
Parameters
733732
-----------
734733
token: :class:`str`
@@ -784,7 +783,6 @@ async def fetch_schedule(
784783

785784
return Schedule(self._http, data)
786785

787-
788786
class BitLeaderboardUser(PartialUser):
789787

790788
__slots__ = "rank", "score"

0 commit comments

Comments
 (0)