Skip to content

Commit bcb7761

Browse files
committed
Fix code style issues with Black
1 parent 2554a0d commit bcb7761

File tree

3 files changed

+40
-26
lines changed

3 files changed

+40
-26
lines changed

twitchio/http.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -534,12 +534,8 @@ async def get_predictions(
534534
return await self.request(Route("GET", "predictions", query=params, token=token), paginate=False)
535535

536536
async def patch_prediction(
537-
self,
538-
token: str,
539-
broadcaster_id: int,
540-
prediction_id: str,
541-
status: str,
542-
winning_outcome_id: str = None):
537+
self, token: str, broadcaster_id: int, prediction_id: str, status: str, winning_outcome_id: str = None
538+
):
543539
body = {
544540
"broadcaster_id": str(broadcaster_id),
545541
"id": prediction_id,
@@ -558,7 +554,9 @@ async def patch_prediction(
558554
)
559555
)
560556

561-
async def post_prediction(self, token: str, broadcaster_id: int, title: str, blue_outcome: str, pink_outcome: str, prediction_window: int):
557+
async def post_prediction(
558+
self, token: str, broadcaster_id: int, title: str, blue_outcome: str, pink_outcome: str, prediction_window: int
559+
):
562560
body = {
563561
"broadcaster_id": broadcaster_id,
564562
"title": title,
@@ -569,7 +567,7 @@ async def post_prediction(self, token: str, broadcaster_id: int, title: str, blu
569567
},
570568
{
571569
"title": pink_outcome,
572-
}
570+
},
573571
],
574572
}
575573
return await self.request(

twitchio/models.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,18 @@ def __repr__(self):
586586

587587
class Prediction:
588588

589-
__slots__ = ("user", "prediction_id", "title", "winning_outcome_id", "outcomes", "prediction_window", "prediction_status", "created_at", "ended_at", "locked_at")
589+
__slots__ = (
590+
"user",
591+
"prediction_id",
592+
"title",
593+
"winning_outcome_id",
594+
"outcomes",
595+
"prediction_window",
596+
"prediction_status",
597+
"created_at",
598+
"ended_at",
599+
"locked_at",
600+
)
590601

591602
def __init__(self, http: "TwitchHTTP", data: dict):
592603
self.user = PartialUser(http, data["broadcaster_id"], data["broadcaster_name"])
@@ -610,6 +621,7 @@ def _parse_time(self, data, field) -> Optional["Datetime"]:
610621
def __repr__(self):
611622
return f"<Prediction user={self.user} prediction_id={self.prediction_id} winning_outcome_id={self.winning_outcome_id} title={self.title}>"
612623

624+
613625
class Predictor:
614626

615627
__slots__ = ("outcome_id", "title", "channel_points", "color")
@@ -619,6 +631,7 @@ def __init__(self, http: "TwitchHTTP", data: dict):
619631
self.channel_points_won: int = data["channel_points_won"]
620632
self.user = PartialUser(http, data["user"]["id"], data["user"]["name"])
621633

634+
622635
class PredictionOutcome:
623636

624637
__slots__ = ("outcome_id", "title", "channel_points", "color", "users", "top_predictors")

twitchio/user.py

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,9 @@ async def fetch_videos(self, period="all", sort="time", type="all", language=Non
609609
data = await self._http.get_videos(user_id=str(self.id), period=period, sort=sort, type=type, language=language)
610610
return [Video(self._http, x, self) for x in data]
611611

612-
async def end_prediction(self, token: str, prediction_id: str, status: str, winning_outcome_id: str = None) -> "Prediction":
612+
async def end_prediction(
613+
self, token: str, prediction_id: str, status: str, winning_outcome_id: str = None
614+
) -> "Prediction":
613615
"""|coro|
614616
End a prediction with an outcome.
615617
@@ -627,11 +629,12 @@ async def end_prediction(self, token: str, prediction_id: str, status: str, winn
627629
from .models import Prediction
628630

629631
data = await self._http.patch_prediction(
630-
token,
631-
broadcaster_id=str(self.id),
632-
prediction_id=prediction_id,
633-
status=status,
634-
winning_outcome_id=winning_outcome_id)
632+
token,
633+
broadcaster_id=str(self.id),
634+
prediction_id=prediction_id,
635+
status=status,
636+
winning_outcome_id=winning_outcome_id,
637+
)
635638
return Prediction(self._http, data[0])
636639

637640
async def get_predictions(self, token: str, prediction_id: str = None) -> List["Prediction"]:
@@ -652,13 +655,12 @@ async def get_predictions(self, token: str, prediction_id: str = None) -> List["
652655
"""
653656
from .models import Prediction
654657

655-
data = await self._http.get_predictions(
656-
token,
657-
broadcaster_id=str(self.id),
658-
prediction_id=prediction_id)
658+
data = await self._http.get_predictions(token, broadcaster_id=str(self.id), prediction_id=prediction_id)
659659
return [Prediction(self._http, d) for d in data]
660660

661-
async def create_prediction(self, token: str, title: str, blue_outcome: str, pink_outcome: str, prediction_window: int) -> "Prediction":
661+
async def create_prediction(
662+
self, token: str, title: str, blue_outcome: str, pink_outcome: str, prediction_window: int
663+
) -> "Prediction":
662664
"""|coro|
663665
Creates a prediction for the channel.
664666
@@ -682,12 +684,13 @@ async def create_prediction(self, token: str, title: str, blue_outcome: str, pin
682684
from .models import Prediction
683685

684686
data = await self._http.post_prediction(
685-
token,
686-
broadcaster_id=str(self.id),
687-
title=title,
688-
blue_outcome=blue_outcome,
689-
pink_outcome=pink_outcome,
690-
prediction_window=prediction_window)
687+
token,
688+
broadcaster_id=str(self.id),
689+
title=title,
690+
blue_outcome=blue_outcome,
691+
pink_outcome=pink_outcome,
692+
prediction_window=prediction_window,
693+
)
691694
return Prediction(self._http, data[0])
692695

693696

0 commit comments

Comments
 (0)