added __all__ to appliciable classes
This commit is contained in:
parent
c9a331b278
commit
739e926d09
|
|
@ -5,7 +5,12 @@ from enum import Enum
|
|||
__all__ = (
|
||||
'SearchType',
|
||||
'TrackType',
|
||||
'PlaylistType'
|
||||
'PlaylistType',
|
||||
'NodeAlgorithm',
|
||||
'LoopMode',
|
||||
'RouteStrategy',
|
||||
'RouteIPType',
|
||||
'URLRegex'
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,16 @@ from typing import TYPE_CHECKING, Union
|
|||
if TYPE_CHECKING:
|
||||
from .player import Player
|
||||
|
||||
__all__ = (
|
||||
'PomiceEvent',
|
||||
'TrackStartEvent',
|
||||
'TrackEndEvent',
|
||||
'TrackStuckEvent',
|
||||
'TrackExceptionEvent',
|
||||
'WebSocketClosedEvent',
|
||||
'WebSocketOpenEvent'
|
||||
)
|
||||
|
||||
|
||||
|
||||
class PomiceEvent:
|
||||
|
|
|
|||
|
|
@ -1,3 +1,26 @@
|
|||
__all__ = (
|
||||
'PomiceException',
|
||||
'NodeException',
|
||||
'NodeCreationError',
|
||||
'NodeConnectionError',
|
||||
'NodeConnectionFailure',
|
||||
'NodeConnectionClosed',
|
||||
'NodeRestException',
|
||||
'NodeNotAvailable',
|
||||
'NoNodesAvailable',
|
||||
'TrackInvalidPosition',
|
||||
'TrackLoadError',
|
||||
'FilterInvalidArgument',
|
||||
'FilterTagInvalid',
|
||||
'FilterTagAlreadyInUse',
|
||||
'InvalidSpotifyClientAuthorization',
|
||||
'AppleMusicNotEnabled',
|
||||
'QueueException',
|
||||
'QueueFull',
|
||||
'QueueEmpty',
|
||||
'LavalinkVersionIncompatible'
|
||||
)
|
||||
|
||||
class PomiceException(Exception):
|
||||
"""Base of all Pomice exceptions."""
|
||||
|
||||
|
|
@ -56,21 +79,6 @@ class FilterTagAlreadyInUse(PomiceException):
|
|||
pass
|
||||
|
||||
|
||||
class SpotifyAlbumLoadFailed(PomiceException):
|
||||
"""The pomice Spotify client was unable to load an album."""
|
||||
pass
|
||||
|
||||
|
||||
class SpotifyTrackLoadFailed(PomiceException):
|
||||
"""The pomice Spotify client was unable to load a track."""
|
||||
pass
|
||||
|
||||
|
||||
class SpotifyPlaylistLoadFailed(PomiceException):
|
||||
"""The pomice Spotify client was unable to load a playlist."""
|
||||
pass
|
||||
|
||||
|
||||
class InvalidSpotifyClientAuthorization(PomiceException):
|
||||
"""No Spotify client authorization was provided for track searching."""
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -1,6 +1,18 @@
|
|||
import collections
|
||||
from .exceptions import FilterInvalidArgument
|
||||
|
||||
__all__ = (
|
||||
'Filter',
|
||||
'Equalizer',
|
||||
'Timescale',
|
||||
'Karaoke',
|
||||
'Tremolo',
|
||||
'Vibrato',
|
||||
'Rotation',
|
||||
'ChannelMix',
|
||||
'Distortion',
|
||||
'LowPass'
|
||||
)
|
||||
|
||||
class Filter:
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ from discord.ext import commands
|
|||
from .enums import SearchType, TrackType, PlaylistType
|
||||
from .filters import Filter
|
||||
|
||||
__all__ = ('Track', 'Playlist')
|
||||
|
||||
|
||||
class Track:
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ from .filters import Filter
|
|||
from .objects import Track
|
||||
from .pool import Node, NodePool
|
||||
|
||||
__all__ = ('Filters', 'Player')
|
||||
|
||||
class Filters:
|
||||
"""Helper class for filters"""
|
||||
__slots__ = ('_filters')
|
||||
|
|
|
|||
|
|
@ -37,8 +37,7 @@ from .routeplanner import RoutePlanner
|
|||
if TYPE_CHECKING:
|
||||
from .player import Player
|
||||
|
||||
_log = logging.getLogger(__name__)
|
||||
|
||||
__all__ = ('Node', 'NodePool')
|
||||
|
||||
class Node:
|
||||
"""The base class for a node.
|
||||
|
|
@ -168,7 +167,6 @@ class Node:
|
|||
|
||||
if data["t"] == "VOICE_SERVER_UPDATE":
|
||||
guild_id = int(data["d"]["guild_id"])
|
||||
_log.debug(f"Recieved voice server update message from guild ID: {guild_id}")
|
||||
try:
|
||||
player = self._players[guild_id]
|
||||
await player.on_voice_server_update(data["d"])
|
||||
|
|
@ -180,7 +178,6 @@ class Node:
|
|||
return
|
||||
|
||||
guild_id = int(data["d"]["guild_id"])
|
||||
_log.debug(f"Recieved voice state update message from guild ID: {guild_id}")
|
||||
try:
|
||||
player = self._players[guild_id]
|
||||
await player.on_voice_state_update(data["d"])
|
||||
|
|
|
|||
|
|
@ -8,10 +8,13 @@ from itertools import zip_longest
|
|||
from datetime import datetime
|
||||
|
||||
|
||||
__all__ = [
|
||||
"ExponentialBackoff",
|
||||
"NodeStats"
|
||||
]
|
||||
__all__ = (
|
||||
'ExponentialBackoff',
|
||||
'NodeStats',
|
||||
'FailingIPBlock',
|
||||
'RouteStats',
|
||||
'Ping'
|
||||
)
|
||||
|
||||
|
||||
class ExponentialBackoff:
|
||||
|
|
|
|||
Loading…
Reference in New Issue