Move error messages into docstrings
This commit is contained in:
parent
8be5351452
commit
5c3487dc8a
@ -108,12 +108,12 @@ def start():
|
|||||||
notice=notice,
|
notice=notice,
|
||||||
super_class=super_class,
|
super_class=super_class,
|
||||||
code=code,
|
code=code,
|
||||||
name="\"{}\"".format(name),
|
docstring='"""{}"""'.format(name),
|
||||||
sub_classes="".join([sub_class_template.format(
|
sub_classes="".join([sub_class_template.format(
|
||||||
sub_class=k[0],
|
sub_class=k[0],
|
||||||
super_class=super_class,
|
super_class=super_class,
|
||||||
id="\"{}\"".format(k[1]),
|
id="\"{}\"".format(k[1]),
|
||||||
message="\"{}\"".format(k[2])
|
docstring='"""{}"""'.format(k[2])
|
||||||
) for k in sub_classes])
|
) for k in sub_classes])
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -4,8 +4,10 @@ from ..error import Error
|
|||||||
|
|
||||||
|
|
||||||
class {super_class}(Error):
|
class {super_class}(Error):
|
||||||
|
{docstring}
|
||||||
CODE = {code}
|
CODE = {code}
|
||||||
NAME = {name}
|
""":obj:`int`: Error Code"""
|
||||||
|
NAME = __doc__
|
||||||
|
|
||||||
|
|
||||||
{sub_classes}
|
{sub_classes}
|
@ -1,5 +1,7 @@
|
|||||||
class {sub_class}({super_class}):
|
class {sub_class}({super_class}):
|
||||||
|
{docstring}
|
||||||
ID = {id}
|
ID = {id}
|
||||||
MESSAGE = {message}
|
""":obj:`str`: Error ID"""
|
||||||
|
MESSAGE = __doc__
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user