Skip to content

Commit

Permalink
Ruff formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
chillymosh committed Nov 22, 2024
1 parent 2a09512 commit 3a05630
Show file tree
Hide file tree
Showing 39 changed files with 506 additions and 506 deletions.
2 changes: 1 addition & 1 deletion twitchio/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class Asset:
+-------------+-------------------------------------------+-----------------------------------------------+
"""

__slots__ = ("_http", "_ext", "_dimensions", "_original_url", "_url", "_name")
__slots__ = ("_dimensions", "_ext", "_http", "_name", "_original_url", "_url")

def __init__(
self,
Expand Down
14 changes: 7 additions & 7 deletions twitchio/authentication/payloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@


__all__ = (
"RefreshTokenPayload",
"ValidateTokenPayload",
"AuthorizationURLPayload",
"ClientCredentialsPayload",
"RefreshTokenPayload",
"UserTokenPayload",
"AuthorizationURLPayload",
"ValidateTokenPayload",
)


Expand All @@ -58,7 +58,7 @@ def __len__(self) -> int:


class RefreshTokenPayload(BasePayload):
__slots__ = ("access_token", "refresh_token", "expires_in", "scope", "token_type")
__slots__ = ("access_token", "expires_in", "refresh_token", "scope", "token_type")

def __init__(self, raw: RefreshTokenResponse, /) -> None:
super().__init__(raw)
Expand All @@ -71,7 +71,7 @@ def __init__(self, raw: RefreshTokenResponse, /) -> None:


class ValidateTokenPayload(BasePayload):
__slots__ = ("client_id", "login", "scopes", "user_id", "expires_in")
__slots__ = ("client_id", "expires_in", "login", "scopes", "user_id")

def __init__(self, raw: ValidateTokenResponse, /) -> None:
super().__init__(raw)
Expand All @@ -84,7 +84,7 @@ def __init__(self, raw: ValidateTokenResponse, /) -> None:


class UserTokenPayload(BasePayload):
__slots__ = ("access_token", "refresh_token", "expires_in", "scope", "token_type")
__slots__ = ("access_token", "expires_in", "refresh_token", "scope", "token_type")

def __init__(self, raw: UserTokenResponse, /) -> None:
super().__init__(raw)
Expand All @@ -108,7 +108,7 @@ def __init__(self, raw: ClientCredentialsResponse, /) -> None:


class AuthorizationURLPayload(BasePayload):
__slots__ = ("url", "client_id", "redirect_uri", "response_type", "scopes", "force_verify", "state")
__slots__ = ("client_id", "force_verify", "redirect_uri", "response_type", "scopes", "state", "url")

def __init__(self, raw: AuthorizationURLResponse, /) -> None:
super().__init__(raw)
Expand Down
6 changes: 3 additions & 3 deletions twitchio/eventsub/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@


__all__ = (
"TransportMethod",
"ShardStatus",
"CloseCode",
"MessageType",
"SubscriptionType",
"RevocationReason",
"ShardStatus",
"SubscriptionType",
"TransportMethod",
)


Expand Down
100 changes: 50 additions & 50 deletions twitchio/eventsub/subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,78 +35,78 @@


__all__ = (
"SubscriptionPayload",
"AdBreakBeginSubscription",
"AutomodMessageHoldSubscription",
"AutomodMessageUpdateSubscription",
"AutomodSettingsUpdateSubscription",
"AutomodTermsUpdateSubscription",
"ChannelUpdateSubscription",
"ChannelFollowSubscription",
"AdBreakBeginSubscription",
"ChatClearSubscription",
"ChatClearUserMessagesSubscription",
"ChatMessageSubscription",
"ChatNotificationSubscription",
"ChatMessageDeleteSubscription",
"ChatSettingsUpdateSubscription",
"ChatUserMessageHoldSubscription",
"ChatUserMessageUpdateSubscription",
"ChannelSubscribeSubscription",
"ChannelSubscriptionEndSubscription",
"ChannelSubscriptionGiftSubscription",
"ChannelSubscribeMessageSubscription",
"ChannelCheerSubscription",
"ChannelRaidSubscription",
"ChannelBanSubscription",
"ChannelUnbanSubscription",
"ChannelUnbanRequestSubscription",
"ChannelUnbanRequestResolveSubscription",
"ChannelCheerSubscription",
"ChannelFollowSubscription",
"ChannelModerateSubscription",
"ChannelModerateV2Subscription",
"ChannelModeratorAddSubscription",
"ChannelModeratorRemoveSubscription",
"ChannelPointsAutoRedeemSubscription",
"ChannelVIPAddSubscription",
"ChannelVIPRemoveSubscription",
"ChannelWarningAcknowledgementSubscription",
"ChannelWarningSendSubscription",
"ChannelPointsRewardAddSubscription",
"ChannelPointsRewardUpdateSubscription",
"ChannelPointsRewardRemoveSubscription",
"ChannelPointsRedeemAddSubscription",
"ChannelPointsRedeemUpdateSubscription",
"ChannelPointsRewardAddSubscription",
"ChannelPointsRewardRemoveSubscription",
"ChannelPointsRewardUpdateSubscription",
"ChannelPollBeginSubscription",
"ChannelPollProgressSubscription",
"ChannelPollEndSubscription",
"SuspiciousUserUpdateSubscription",
"SuspiciousUserMessageSubscription",
"ChannelPollProgressSubscription",
"ChannelPredictionBeginSubscription",
"ChannelPredictionEndSubscription",
"ChannelPredictionLockSubscription",
"ChannelPredictionProgressSubscription",
"ChannelRaidSubscription",
"ChannelSubscribeMessageSubscription",
"ChannelSubscribeSubscription",
"ChannelSubscriptionEndSubscription",
"ChannelSubscriptionGiftSubscription",
"ChannelUnbanRequestResolveSubscription",
"ChannelUnbanRequestSubscription",
"ChannelUnbanSubscription",
"ChannelUpdateSubscription",
"ChannelVIPAddSubscription",
"ChannelVIPRemoveSubscription",
"ChannelWarningAcknowledgementSubscription",
"ChannelWarningSendSubscription",
"CharityCampaignProgressSubscription",
"CharityCampaignStartSubscription",
"CharityCampaignStopSubscription",
"CharityDonationSubscription",
"ChatClearSubscription",
"ChatClearUserMessagesSubscription",
"ChatMessageDeleteSubscription",
"ChatMessageSubscription",
"ChatNotificationSubscription",
"ChatSettingsUpdateSubscription",
"ChatUserMessageHoldSubscription",
"ChatUserMessageUpdateSubscription",
"GoalBeginSubscription",
"GoalProgressSubscription",
"GoalEndSubscription",
"GoalProgressSubscription",
"HypeTrainBeginSubscription",
"HypeTrainProgressSubscription",
"HypeTrainEndSubscription",
"HypeTrainProgressSubscription",
"SharedChatSessionBeginSubscription",
"SharedChatSessionEndSubscription",
"SharedChatSessionUpdateSubscription",
"ShieldModeBeginSubscription",
"ShieldModeEndSubscription",
"ShoutoutCreateSubscription",
"ShoutoutReceiveSubscription",
"StreamOnlineSubscription",
"StreamOfflineSubscription",
"StreamOnlineSubscription",
"SubscriptionPayload",
"SuspiciousUserMessageSubscription",
"SuspiciousUserUpdateSubscription",
"UserAuthorizationGrantSubscription",
"UserAuthorizationRevokeSubscription",
"UserUpdateSubscription",
"WhisperReceivedSubscription",
"CharityDonationSubscription",
"CharityCampaignStartSubscription",
"CharityCampaignProgressSubscription",
"CharityCampaignStopSubscription",
"ChannelPredictionBeginSubscription",
"ChannelPredictionLockSubscription",
"ChannelPredictionProgressSubscription",
"ChannelPredictionEndSubscription",
"SharedChatSessionBeginSubscription",
"SharedChatSessionEndSubscription",
"SharedChatSessionUpdateSubscription",
)


Expand Down Expand Up @@ -136,18 +136,18 @@ class SubscriptionPayload(abc.ABC):
version: ClassVar[Any]

__slots__ = (
"broadcaster_id",
"broadcaster_user_id",
"moderator_user_id",
"user_id",
"campaign_id",
"category_id",
"organization_id",
"client_id",
"conduit_id",
"reward_id",
"from_broadcaster_user_id",
"moderator_user_id",
"organization_id",
"reward_id",
"to_broadcaster_user_id",
"broadcaster_id",
"user_id",
)

def __init__(self, **condition: Unpack[Condition]) -> None:
Expand Down
26 changes: 13 additions & 13 deletions twitchio/eventsub/websockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,25 +66,25 @@

class Websocket:
__slots__ = (
"_keep_alive_timeout",
"__subscription_cost",
"_backoff",
"_client",
"_closed",
"_connecting",
"_connection_tasks",
"_heartbeat",
"_last_keepalive",
"_http",
"_keep_alive_task",
"_session_id",
"_socket",
"_keep_alive_timeout",
"_last_keepalive",
"_listen_task",
"_original_attempts",
"_ready",
"_reconnect_attempts",
"_backoff",
"__subscription_cost",
"_client",
"_token_for",
"_http",
"_session_id",
"_socket",
"_subscriptions",
"_closed",
"_connecting",
"_original_attempts",
"_connection_tasks",
"_token_for",
)

def __init__(
Expand Down
2 changes: 1 addition & 1 deletion twitchio/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from typing import TYPE_CHECKING, Any


__all__ = ("TwitchioException", "HTTPException", "WebsocketConnectionException", "MessageRejectedError")
__all__ = ("HTTPException", "MessageRejectedError", "TwitchioException", "WebsocketConnectionException")


if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion twitchio/ext/commands/cooldowns.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from .context import Context


__all__ = ("BaseCooldown", "Cooldown", "GCRACooldown", "BucketType", "Bucket")
__all__ = ("BaseCooldown", "Bucket", "BucketType", "Cooldown", "GCRACooldown")


PT = TypeVar("PT")
Expand Down
14 changes: 7 additions & 7 deletions twitchio/ext/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@


__all__ = (
"CommandErrorPayload",
"Command",
"Mixin",
"CommandErrorPayload",
"Group",
"Mixin",
"command",
"cooldown",
"group",
"guard",
"is_owner",
"is_staff",
"is_broadcaster",
"is_elevated",
"is_moderator",
"is_owner",
"is_staff",
"is_vip",
"is_elevated",
"cooldown",
)


Expand Down Expand Up @@ -775,7 +775,7 @@ async def _invoke(self, context: Context) -> None:
context._invoked_with = f"{context._invoked_with} {trigger}"
context._subcommand_trigger = trigger or None

if not trigger or not next_ and self._invoke_fallback:
if not trigger or (not next_ and self._invoke_fallback):
view.undo()
await super()._invoke(context=context)

Expand Down
18 changes: 9 additions & 9 deletions twitchio/ext/commands/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@


__all__ = (
"ArgumentError",
"BadArgument",
"CommandError",
"ComponentLoadError",
"CommandInvokeError",
"CommandExistsError",
"CommandHookError",
"CommandInvokeError",
"CommandNotFound",
"CommandExistsError",
"PrefixError",
"InputError",
"ArgumentError",
"GuardFailure",
"CommandOnCooldown",
"ComponentLoadError",
"ConversionError",
"BadArgument",
"GuardFailure",
"InputError",
"MissingRequiredArgument",
"ModuleAlreadyLoadedError",
"ModuleLoadFailure",
"ModuleNotLoadedError",
"NoEntryPointError",
"CommandOnCooldown",
"PrefixError",
)


Expand Down
Loading

0 comments on commit 3a05630

Please sign in to comment.