Consistent use of __all__ to prevent merge conflicts.
This commit is contained in:
		| @@ -30,7 +30,12 @@ from .enums import ActivityType, try_enum | |||||||
| from .colour import Colour | from .colour import Colour | ||||||
| from .utils import _get_as_snowflake | from .utils import _get_as_snowflake | ||||||
|  |  | ||||||
| __all__ = ['Activity', 'Streaming', 'Game', 'Spotify'] | __all__ = ( | ||||||
|  |     'Activity', | ||||||
|  |     'Streaming', | ||||||
|  |     'Game', | ||||||
|  |     'Spotify', | ||||||
|  | ) | ||||||
|  |  | ||||||
| """If curious, this is the current schema for an activity. | """If curious, this is the current schema for an activity. | ||||||
|  |  | ||||||
|   | |||||||
| @@ -36,7 +36,7 @@ from .asset import Asset | |||||||
| from .errors import ClientException, NoMoreItems | from .errors import ClientException, NoMoreItems | ||||||
| from .webhook import Webhook | from .webhook import Webhook | ||||||
|  |  | ||||||
| __all__ = [ | __all__ = ( | ||||||
|     'TextChannel', |     'TextChannel', | ||||||
|     'VoiceChannel', |     'VoiceChannel', | ||||||
|     'DMChannel', |     'DMChannel', | ||||||
| @@ -44,7 +44,7 @@ __all__ = [ | |||||||
|     'StoreChannel', |     'StoreChannel', | ||||||
|     'GroupChannel', |     'GroupChannel', | ||||||
|     '_channel_factory', |     '_channel_factory', | ||||||
| ] | ) | ||||||
|  |  | ||||||
| async def _single_delete_strategy(messages): | async def _single_delete_strategy(messages): | ||||||
|     for m in messages: |     for m in messages: | ||||||
|   | |||||||
| @@ -26,11 +26,27 @@ DEALINGS IN THE SOFTWARE. | |||||||
|  |  | ||||||
| from enum import Enum | from enum import Enum | ||||||
|  |  | ||||||
| __all__ = ['ChannelType', 'MessageType', 'VoiceRegion', 'SpeakingState', | __all__ = ( | ||||||
|            'VerificationLevel', 'ContentFilter', 'Status', 'DefaultAvatar', |     'ChannelType', | ||||||
|            'RelationshipType', 'AuditLogAction', 'AuditLogActionCategory', |     'MessageType', | ||||||
|            'UserFlags', 'ActivityType', 'HypeSquadHouse', 'NotificationLevel', |     'VoiceRegion', | ||||||
|            'PremiumType', 'UserContentFilter', 'FriendFlags', 'Theme'] |     'SpeakingState', | ||||||
|  |     'VerificationLevel', | ||||||
|  |     'ContentFilter', | ||||||
|  |     'Status', | ||||||
|  |     'DefaultAvatar', | ||||||
|  |     'RelationshipType', | ||||||
|  |     'AuditLogAction', | ||||||
|  |     'AuditLogActionCategory', | ||||||
|  |     'UserFlags', | ||||||
|  |     'ActivityType', | ||||||
|  |     'HypeSquadHouse', | ||||||
|  |     'NotificationLevel', | ||||||
|  |     'PremiumType', | ||||||
|  |     'UserContentFilter', | ||||||
|  |     'FriendFlags', | ||||||
|  |     'Theme', | ||||||
|  | ) | ||||||
|  |  | ||||||
| def fast_lookup(cls): | def fast_lookup(cls): | ||||||
|     # NOTE: implies hashable |     # NOTE: implies hashable | ||||||
|   | |||||||
| @@ -28,7 +28,10 @@ import inspect | |||||||
| import copy | import copy | ||||||
| from ._types import _BaseCommand | from ._types import _BaseCommand | ||||||
|  |  | ||||||
| __all__ = ('CogMeta', 'Cog') | __all__ = ( | ||||||
|  |     'CogMeta', | ||||||
|  |     'Cog', | ||||||
|  | ) | ||||||
|  |  | ||||||
| class CogMeta(type): | class CogMeta(type): | ||||||
|     """A metaclass for defining a cog. |     """A metaclass for defining a cog. | ||||||
|   | |||||||
| @@ -31,11 +31,24 @@ import discord | |||||||
|  |  | ||||||
| from .errors import BadArgument, NoPrivateMessage | from .errors import BadArgument, NoPrivateMessage | ||||||
|  |  | ||||||
| __all__ = ['Converter', 'MemberConverter', 'UserConverter', 'MessageConverter', | __all__ = ( | ||||||
|            'TextChannelConverter', 'InviteConverter', 'RoleConverter', |     'Converter', | ||||||
|            'GameConverter', 'ColourConverter', 'VoiceChannelConverter', |     'MemberConverter', | ||||||
|            'EmojiConverter', 'PartialEmojiConverter', 'CategoryChannelConverter', |     'UserConverter', | ||||||
|            'IDConverter', 'clean_content', 'Greedy'] |     'MessageConverter', | ||||||
|  |     'TextChannelConverter', | ||||||
|  |     'InviteConverter', | ||||||
|  |     'RoleConverter', | ||||||
|  |     'GameConverter', | ||||||
|  |     'ColourConverter', | ||||||
|  |     'VoiceChannelConverter', | ||||||
|  |     'EmojiConverter', | ||||||
|  |     'PartialEmojiConverter', | ||||||
|  |     'CategoryChannelConverter', | ||||||
|  |     'IDConverter', | ||||||
|  |     'clean_content', | ||||||
|  |     'Greedy', | ||||||
|  | ) | ||||||
|  |  | ||||||
| def _get_from_guilds(bot, getter, argument): | def _get_from_guilds(bot, getter, argument): | ||||||
|     result = None |     result = None | ||||||
|   | |||||||
| @@ -27,7 +27,11 @@ DEALINGS IN THE SOFTWARE. | |||||||
| import enum | import enum | ||||||
| import time | import time | ||||||
|  |  | ||||||
| __all__ = ['BucketType', 'Cooldown', 'CooldownMapping'] | __all__ = ( | ||||||
|  |     'BucketType', | ||||||
|  |     'Cooldown', | ||||||
|  |     'CooldownMapping', | ||||||
|  | ) | ||||||
|  |  | ||||||
| class BucketType(enum.Enum): | class BucketType(enum.Enum): | ||||||
|     default  = 0 |     default  = 0 | ||||||
|   | |||||||
| @@ -38,10 +38,25 @@ from . import converter as converters | |||||||
| from ._types import _BaseCommand | from ._types import _BaseCommand | ||||||
| from .cog import Cog | from .cog import Cog | ||||||
|  |  | ||||||
| __all__ = ['Command', 'Group', 'GroupMixin', 'command', 'group', | __all__ = ( | ||||||
|            'has_role', 'has_permissions', 'has_any_role', 'check', |     'Command', | ||||||
|            'bot_has_role', 'bot_has_permissions', 'bot_has_any_role', |     'Group', | ||||||
|            'cooldown', 'dm_only', 'guild_only', 'is_owner', 'is_nsfw'] |     'GroupMixin', | ||||||
|  |     'command', | ||||||
|  |     'group', | ||||||
|  |     'has_role', | ||||||
|  |     'has_permissions', | ||||||
|  |     'has_any_role', | ||||||
|  |     'check', | ||||||
|  |     'bot_has_role', | ||||||
|  |     'bot_has_permissions', | ||||||
|  |     'bot_has_any_role', | ||||||
|  |     'cooldown', | ||||||
|  |     'dm_only', | ||||||
|  |     'guild_only', | ||||||
|  |     'is_owner', | ||||||
|  |     'is_nsfw', | ||||||
|  | ) | ||||||
|  |  | ||||||
| def wrap_callback(coro): | def wrap_callback(coro): | ||||||
|     @functools.wraps(coro) |     @functools.wraps(coro) | ||||||
|   | |||||||
| @@ -27,17 +27,40 @@ DEALINGS IN THE SOFTWARE. | |||||||
| from discord.errors import DiscordException | from discord.errors import DiscordException | ||||||
|  |  | ||||||
|  |  | ||||||
| __all__ = ['CommandError', 'MissingRequiredArgument', 'BadArgument', | __all__ = ( | ||||||
|            'PrivateMessageOnly', 'NoPrivateMessage', 'CheckFailure', |     'CommandError', | ||||||
|            'CommandNotFound', 'DisabledCommand', 'CommandInvokeError', |     'MissingRequiredArgument', | ||||||
|            'TooManyArguments','UserInputError', 'CommandOnCooldown', |     'BadArgument', | ||||||
|            'NotOwner', 'MissingRole', 'BotMissingRole', 'MissingAnyRole', |     'PrivateMessageOnly', | ||||||
|            'BotMissingAnyRole','MissingPermissions', 'BotMissingPermissions', |     'NoPrivateMessage', | ||||||
|            'NSFWChannelRequired', 'ConversionError', 'BadUnionArgument', |     'CheckFailure', | ||||||
|            'ArgumentParsingError', 'UnexpectedQuoteError', 'InvalidEndOfQuotedStringError', |     'CommandNotFound', | ||||||
|            'ExpectedClosingQuoteError', 'ExtensionError', 'ExtensionAlreadyLoaded', |     'DisabledCommand', | ||||||
|            'ExtensionNotLoaded', 'NoEntryPointError', 'ExtensionFailed', |     'CommandInvokeError', | ||||||
|            'ExtensionNotFound'] |     'TooManyArguments', | ||||||
|  |     'UserInputError', | ||||||
|  |     'CommandOnCooldown', | ||||||
|  |     'NotOwner', | ||||||
|  |     'MissingRole', | ||||||
|  |     'BotMissingRole', | ||||||
|  |     'MissingAnyRole', | ||||||
|  |     'BotMissingAnyRole', | ||||||
|  |     'MissingPermissions', | ||||||
|  |     'BotMissingPermissions', | ||||||
|  |     'NSFWChannelRequired', | ||||||
|  |     'ConversionError', | ||||||
|  |     'BadUnionArgument', | ||||||
|  |     'ArgumentParsingError', | ||||||
|  |     'UnexpectedQuoteError', | ||||||
|  |     'InvalidEndOfQuotedStringError', | ||||||
|  |     'ExpectedClosingQuoteError', | ||||||
|  |     'ExtensionError', | ||||||
|  |     'ExtensionAlreadyLoaded', | ||||||
|  |     'ExtensionNotLoaded', | ||||||
|  |     'NoEntryPointError', | ||||||
|  |     'ExtensionFailed', | ||||||
|  |     'ExtensionNotFound', | ||||||
|  | ) | ||||||
|  |  | ||||||
| class CommandError(DiscordException): | class CommandError(DiscordException): | ||||||
|     r"""The base exception type for all command related errors. |     r"""The base exception type for all command related errors. | ||||||
|   | |||||||
| @@ -33,12 +33,12 @@ import discord.utils | |||||||
| from .core import Group, Command | from .core import Group, Command | ||||||
| from .errors import CommandError | from .errors import CommandError | ||||||
|  |  | ||||||
| __all__ = [ | __all__ = ( | ||||||
|     'Paginator', |     'Paginator', | ||||||
|     'HelpCommand', |     'HelpCommand', | ||||||
|     'DefaultHelpCommand', |     'DefaultHelpCommand', | ||||||
|     'MinimalHelpCommand', |     'MinimalHelpCommand', | ||||||
| ] | ) | ||||||
|  |  | ||||||
| # help -> shows info of bot on top/bottom and lists subcommands | # help -> shows info of bot on top/bottom and lists subcommands | ||||||
| # help command -> shows detailed info of command | # help command -> shows detailed info of command | ||||||
|   | |||||||
| @@ -44,8 +44,13 @@ from .errors import ConnectionClosed, InvalidArgument | |||||||
|  |  | ||||||
| log = logging.getLogger(__name__) | log = logging.getLogger(__name__) | ||||||
|  |  | ||||||
| __all__ = ['DiscordWebSocket', 'KeepAliveHandler', 'VoiceKeepAliveHandler', | __all__ = ( | ||||||
|            'DiscordVoiceWebSocket', 'ResumeWebSocket'] |     'DiscordWebSocket', | ||||||
|  |     'KeepAliveHandler', | ||||||
|  |     'VoiceKeepAliveHandler', | ||||||
|  |     'DiscordVoiceWebSocket', | ||||||
|  |     'ResumeWebSocket', | ||||||
|  | ) | ||||||
|  |  | ||||||
| class ResumeWebSocket(Exception): | class ResumeWebSocket(Exception): | ||||||
|     """Signals to initialise via RESUME opcode instead of IDENTIFY.""" |     """Signals to initialise via RESUME opcode instead of IDENTIFY.""" | ||||||
|   | |||||||
| @@ -37,7 +37,12 @@ from .opus import Encoder as OpusEncoder | |||||||
|  |  | ||||||
| log = logging.getLogger(__name__) | log = logging.getLogger(__name__) | ||||||
|  |  | ||||||
| __all__ = ['AudioSource', 'PCMAudio', 'FFmpegPCMAudio', 'PCMVolumeTransformer'] | __all__ = ( | ||||||
|  |     'AudioSource', | ||||||
|  |     'PCMAudio', | ||||||
|  |     'FFmpegPCMAudio', | ||||||
|  |     'PCMVolumeTransformer', | ||||||
|  | ) | ||||||
|  |  | ||||||
| class AudioSource: | class AudioSource: | ||||||
|     """Represents an audio stream. |     """Represents an audio stream. | ||||||
|   | |||||||
| @@ -36,7 +36,12 @@ from .errors import InvalidArgument, HTTPException, Forbidden, NotFound | |||||||
| from .user import BaseUser, User | from .user import BaseUser, User | ||||||
| from .asset import Asset | from .asset import Asset | ||||||
|  |  | ||||||
| __all__ = ['WebhookAdapter', 'AsyncWebhookAdapter', 'RequestsWebhookAdapter', 'Webhook'] | __all__ = ( | ||||||
|  |     'WebhookAdapter', | ||||||
|  |     'AsyncWebhookAdapter', | ||||||
|  |     'RequestsWebhookAdapter', | ||||||
|  |     'Webhook', | ||||||
|  | ) | ||||||
|  |  | ||||||
| class WebhookAdapter: | class WebhookAdapter: | ||||||
|     """Base class for all webhook adapters. |     """Base class for all webhook adapters. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user