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