Passage aux erreurs en anglais
This commit is contained in:
parent
f6b5faf808
commit
97c1756add
@ -22,8 +22,6 @@ class Bool(BaseType):
|
||||
"""
|
||||
Check if value is a correct bool
|
||||
|
||||
Check if value is int, and if applicable, between ``min`` and ``max`` or in ``values``
|
||||
|
||||
:Basic usage:
|
||||
|
||||
>>> my_bool = Bool()
|
||||
@ -74,7 +72,7 @@ class Bool(BaseType):
|
||||
:param bool value: Value to set
|
||||
"""
|
||||
if not self.check_value(value):
|
||||
raise ValueError("Tentative de définir une valeur incompatible")
|
||||
raise ValueError("Attempt to set incompatible value.")
|
||||
self.value = bool(value)
|
||||
|
||||
def get(self) -> typing.Optional[bool]:
|
||||
@ -122,7 +120,7 @@ class Bool(BaseType):
|
||||
:param bool value: Value to load
|
||||
"""
|
||||
if not self.check_value(value):
|
||||
raise ValueError("Tentative de charger une donnée incompatible.")
|
||||
raise ValueError("Attempt to load incompatible value.")
|
||||
self.value = value
|
||||
|
||||
def __repr__(self):
|
||||
|
@ -62,7 +62,7 @@ class Color(BaseType):
|
||||
:param int value: Value to set
|
||||
"""
|
||||
if not self.check_value(value):
|
||||
raise ValueError("Tentative de définir une valeur incompatible")
|
||||
raise ValueError("Attempt to set incompatible value.")
|
||||
self.value = int(value)
|
||||
|
||||
def get(self) -> typing.Optional[int]:
|
||||
@ -110,7 +110,7 @@ class Color(BaseType):
|
||||
:param int value: Value to load
|
||||
"""
|
||||
if not self.check_value(value):
|
||||
raise ValueError("Tentative de charger une donnée incompatible.")
|
||||
raise ValueError("Attempt to load incompatible value.")
|
||||
self.value = value
|
||||
|
||||
def __repr__(self):
|
||||
|
@ -76,7 +76,7 @@ class Dict(BaseType):
|
||||
"""
|
||||
new_dict = dict()
|
||||
if not self.check_value(value):
|
||||
raise ValueError("Tentative de définir une valeur incompatible")
|
||||
raise ValueError("Attempt to set incompatible value.")
|
||||
for k, v in value.items():
|
||||
new_key = self.type_key()
|
||||
new_key.set(k)
|
||||
|
@ -31,7 +31,7 @@ class Channel(BaseType):
|
||||
|
||||
def set(self, value):
|
||||
if not self.check_value(value):
|
||||
raise ValueError("Tentative de définir une valeur incompatible")
|
||||
raise ValueError("Attempt to set incompatible value.")
|
||||
self.value = value
|
||||
self._update()
|
||||
|
||||
@ -46,7 +46,7 @@ class Channel(BaseType):
|
||||
def load(self, value):
|
||||
|
||||
if self.check_value(value):
|
||||
raise ValueError("Tentative de charger une donnée incompatible.")
|
||||
raise ValueError("Attempt to load incompatible value.")
|
||||
self.set(value)
|
||||
self._update()
|
||||
|
||||
|
@ -79,7 +79,7 @@ class Guild(BaseType):
|
||||
:type value: Union[int, discord.Guild]
|
||||
"""
|
||||
if not self.check_value(value):
|
||||
raise ValueError("Tentative de définir une valeur incompatible")
|
||||
raise ValueError("Attempt to set incompatible value.")
|
||||
self.value = value
|
||||
self._update()
|
||||
|
||||
@ -138,7 +138,7 @@ class Guild(BaseType):
|
||||
:type value: Union[int, discord.Guild]
|
||||
"""
|
||||
if self.check_value(value):
|
||||
raise ValueError("Tentative de charger une donnée incompatible.")
|
||||
raise ValueError("Attempt to load incompatible value.")
|
||||
self.set(value)
|
||||
self._update()
|
||||
|
||||
|
@ -20,7 +20,7 @@ class Role(BaseType):
|
||||
if self.check_value(value):
|
||||
self.value = value
|
||||
return
|
||||
raise ValueError("Tentative de définir une valeur incompatible")
|
||||
raise ValueError("Attempt to set incompatible value.")
|
||||
|
||||
def get(self):
|
||||
return self.value
|
||||
@ -30,5 +30,5 @@ class Role(BaseType):
|
||||
|
||||
def load(self, value):
|
||||
if self.check_value(value):
|
||||
raise ValueError("Tentative de charger une donnée incompatible.")
|
||||
raise ValueError("Attempt to load incompatible value.")
|
||||
self.value = value
|
||||
|
@ -22,7 +22,7 @@ class User(BaseType):
|
||||
if self.check_value(value):
|
||||
self.value = value
|
||||
return
|
||||
raise ValueError("Tentative de définir une valeur incompatible")
|
||||
raise ValueError("Attempt to set incompatible value.")
|
||||
|
||||
def get(self):
|
||||
return self.value
|
||||
@ -32,5 +32,5 @@ class User(BaseType):
|
||||
|
||||
def load(self, value):
|
||||
if self.check_value(value):
|
||||
raise ValueError("Tentative de charger une donnée incompatible.")
|
||||
raise ValueError("Attempt to load incompatible value.")
|
||||
self.value = value
|
@ -98,7 +98,7 @@ class Float(BaseType):
|
||||
:param float value: Value to set
|
||||
"""
|
||||
if not self.check_value(value):
|
||||
raise ValueError("Tentative de définir une valeur incompatible")
|
||||
raise ValueError("Attempt to set incompatible value.")
|
||||
self.value = float(value)
|
||||
|
||||
def get(self) -> float:
|
||||
@ -146,7 +146,7 @@ class Float(BaseType):
|
||||
:param float value: Value to load
|
||||
"""
|
||||
if not self.check_value(value):
|
||||
raise ValueError("Tentative de charger une donnée incompatible.")
|
||||
raise ValueError("Attempt to load incompatible value.")
|
||||
self.value = value
|
||||
|
||||
def __repr__(self):
|
||||
|
@ -117,7 +117,7 @@ class Int(BaseType):
|
||||
:param int value: Value to set
|
||||
"""
|
||||
if not self.check_value(value):
|
||||
raise ValueError("Tentative de définir une valeur incompatible")
|
||||
raise ValueError("Attempt to set incompatible value.")
|
||||
self.value = int(value)
|
||||
|
||||
def get(self) -> typing.Optional[int]:
|
||||
@ -165,7 +165,7 @@ class Int(BaseType):
|
||||
:param int value: Value to load
|
||||
"""
|
||||
if not self.check_value(value):
|
||||
raise ValueError("Tentative de charger une donnée incompatible.")
|
||||
raise ValueError("Attempt to load incompatible value.")
|
||||
self.value = value
|
||||
|
||||
def __repr__(self):
|
||||
|
@ -70,7 +70,7 @@ class List(BaseType):
|
||||
:param typing.List[typing.Any] value: Value to set
|
||||
"""
|
||||
if not self.check_value(value):
|
||||
raise ValueError('Tentative de définir une valeur incompatible')
|
||||
raise ValueError('Attempt to set incompatible value.')
|
||||
new_liste = []
|
||||
for v in value:
|
||||
new_element = self.type_()
|
||||
@ -128,7 +128,7 @@ class List(BaseType):
|
||||
:param typing.List[typing.Any] value: Value to load
|
||||
"""
|
||||
if not self.check_value(value):
|
||||
raise ValueError("Tentative de charger une donnée incompatible.")
|
||||
raise ValueError("Attempt to load incompatible value.")
|
||||
for v in value:
|
||||
new_object = self.type_()
|
||||
new_object.load(v)
|
||||
|
@ -52,7 +52,7 @@ class Str(BaseType):
|
||||
:return: None
|
||||
"""
|
||||
if not self.check_value(value):
|
||||
raise ValueError("Tentative de définir une valeur incompatible")
|
||||
raise ValueError("Attempt to set incompatible value.")
|
||||
self.value = str(value)
|
||||
|
||||
def get(self) -> str:
|
||||
@ -103,7 +103,7 @@ class Str(BaseType):
|
||||
'34'
|
||||
"""
|
||||
if not self.check_value(value):
|
||||
raise ValueError("Tentative de charger une donnée incompatible.")
|
||||
raise ValueError("Attempt to load incompatible value.")
|
||||
self.value = value
|
||||
|
||||
def __repr__(self):
|
||||
|
Loading…
Reference in New Issue
Block a user