Passed
Push — main ( e07039...aa27d6 )
by
unknown
01:38
created

pincer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 78
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 55
dl 0
loc 78
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A VersionInfo.__repr__() 0 4 1
1
"""
2
Pincer library
3
====================
4
An asynchronous python API wrapper meant to replace discord.py
5
6
Copyright Pincer 2021
7
Full MIT License can be found in `LICENSE` at the project root.
8
"""
9
10
from typing import NamedTuple, Literal, Optional
11
12
from ._config import GatewayConfig
13
from .client import event_middleware, Client, Bot
14
from .commands import command, ChatCommandHandler
15
from .exceptions import (
16
    PincerError, InvalidPayload, UnhandledException, NoExportMethod,
17
    CogError, CogNotFound, CogAlreadyExists, NoValidSetupMethod,
18
    TooManySetupArguments, NoCogManagerReturnFound, CommandError,
19
    CommandCooldownError, CommandIsNotCoroutine, CommandAlreadyRegistered,
20
    CommandDescriptionTooLong, TooManyArguments, InvalidArgumentAnnotation,
21
    CommandReturnIsEmpty, InvalidCommandGuild, InvalidCommandName,
22
    InvalidEventName, InvalidUrlError, EmbedFieldError, TaskError,
23
    TaskAlreadyRunning, TaskCancelError, TaskIsNotCoroutine, TaskInvalidDelay,
24
    DispatchError, DisallowedIntentsError, InvalidTokenError, HeartbeatError,
25
    UnavailableGuildError, HTTPError, NotModifiedError, BadRequestError,
26
    UnauthorizedError, ForbiddenError, NotFoundError, MethodNotAllowedError,
27
    RateLimitError, GatewayError, ServerError, EmbedOverflow, ImageEncodingError
28
)
29
from .objects import Intents
30
31
__package__ = "pincer"
32
__title__ = "Pincer library"
33
__description__ = "Discord API wrapper rebuild from scratch."
34
__author__ = "Sigmanificient, Arthurdw"
35
__email__ = "[email protected]"
36
__license__ = "MIT"
37
38
ReleaseType = Optional[Literal["alpha", "beta", "candidate", "final", "dev"]]
39
40
41
class VersionInfo(NamedTuple):
42
    """A Class representing the version of the Pincer library."""
43
44
    major: int
45
    minor: int
46
    micro: int
47
48
    release_level: ReleaseType = None
49
    serial: int = 0
50
51
    def __repr__(self) -> str:
52
        return f"{self.major}.{self.minor}.{self.micro}" + (
53
                f"-{self.release_level}{self.serial}"
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation (remove 4 spaces).
Loading history...
54
                * (self.release_level is not None)
0 ignored issues
show
Coding Style introduced by
Wrong hanging indentation (remove 4 spaces).
Loading history...
55
        )
56
57
58
version_info = VersionInfo(0, 13, 0)
59
__version__ = repr(version_info)
60
61
__all__ = (
62
    "BadRequestError", "Bot", "ChatCommandHandler", "Client",
63
    "CogAlreadyExists", "CogError", "CogNotFound", "CommandAlreadyRegistered",
64
    "CommandCooldownError", "CommandDescriptionTooLong", "CommandError",
65
    "CommandIsNotCoroutine", "CommandReturnIsEmpty", "DisallowedIntentsError",
66
    "DispatchError", "EmbedFieldError", "EmbedOverflow", "ForbiddenError",
67
    "GatewayConfig", "GatewayError", "HTTPError", "HeartbeatError",
68
    "ImageEncodingError", "Intents", "InvalidArgumentAnnotation",
69
    "InvalidCommandGuild", "InvalidCommandName", "InvalidEventName",
70
    "InvalidPayload", "InvalidTokenError", "InvalidUrlError",
71
    "MethodNotAllowedError", "NoCogManagerReturnFound", "NoExportMethod",
72
    "NoValidSetupMethod", "NotFoundError", "NotModifiedError", "PincerError",
73
    "RateLimitError", "ServerError", "TaskAlreadyRunning", "TaskCancelError",
74
    "TaskError", "TaskInvalidDelay", "TaskIsNotCoroutine", "TooManyArguments",
75
    "TooManySetupArguments", "UnauthorizedError", "UnavailableGuildError",
76
    "UnhandledException", "__author__", "__email__", "__package__",
77
    "__title__", "__version__", "command", "event_middleware"
78
)
79