mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -05:00
[V3] Update code standards (black code format pass) (#1650)
* ran black: code formatter against `redbot/` with `-l 99` * badge
This commit is contained in:
@@ -4,16 +4,15 @@ __all__ = ["Config", "__version__"]
|
||||
|
||||
|
||||
class VersionInfo:
|
||||
|
||||
def __init__(self, major, minor, micro, releaselevel, serial):
|
||||
self._levels = ['alpha', 'beta', 'final']
|
||||
self._levels = ["alpha", "beta", "final"]
|
||||
self.major = major
|
||||
self.minor = minor
|
||||
self.micro = micro
|
||||
|
||||
if releaselevel not in self._levels:
|
||||
raise TypeError("'releaselevel' must be one of: {}".format(
|
||||
', '.join(self._levels)
|
||||
))
|
||||
raise TypeError("'releaselevel' must be one of: {}".format(", ".join(self._levels)))
|
||||
|
||||
self.releaselevel = releaselevel
|
||||
self.serial = serial
|
||||
@@ -21,8 +20,9 @@ class VersionInfo:
|
||||
def __lt__(self, other):
|
||||
my_index = self._levels.index(self.releaselevel)
|
||||
other_index = self._levels.index(other.releaselevel)
|
||||
return (self.major, self.minor, self.micro, my_index, self.serial) < \
|
||||
(other.major, other.minor, other.micro, other_index, other.serial)
|
||||
return (self.major, self.minor, self.micro, my_index, self.serial) < (
|
||||
other.major, other.minor, other.micro, other_index, other.serial
|
||||
)
|
||||
|
||||
def __repr__(self):
|
||||
return "VersionInfo(major={}, minor={}, micro={}, releaselevel={}, serial={})".format(
|
||||
@@ -32,5 +32,6 @@ class VersionInfo:
|
||||
def to_json(self):
|
||||
return [self.major, self.minor, self.micro, self.releaselevel, self.serial]
|
||||
|
||||
|
||||
__version__ = "3.0.0b14"
|
||||
version_info = VersionInfo(3, 0, 0, 'beta', 14)
|
||||
version_info = VersionInfo(3, 0, 0, "beta", 14)
|
||||
|
||||
Reference in New Issue
Block a user