mirror of https://github.com/coddrago/Heroku
Fix `@loader.inline_handler` processing
parent
1fd2966ca6
commit
fed8d35a0d
|
@ -350,7 +350,7 @@ def translatable_docstring(cls):
|
||||||
|
|
||||||
@wraps(cls.config_complete)
|
@wraps(cls.config_complete)
|
||||||
def config_complete(self, *args, **kwargs):
|
def config_complete(self, *args, **kwargs):
|
||||||
def proccess_decorators(mark: str):
|
def proccess_decorators(mark: str, obj: str):
|
||||||
nonlocal self
|
nonlocal self
|
||||||
for attr in dir(func_):
|
for attr in dir(func_):
|
||||||
if (
|
if (
|
||||||
|
@ -363,18 +363,18 @@ def translatable_docstring(cls):
|
||||||
setattr(self, var, {})
|
setattr(self, var, {})
|
||||||
|
|
||||||
getattr(self, var).setdefault(
|
getattr(self, var).setdefault(
|
||||||
f"{mark}{command_}", getattr(func_, attr)
|
f"{mark}{obj}", getattr(func_, attr)
|
||||||
)
|
)
|
||||||
|
|
||||||
for command_, func_ in get_commands(cls).items():
|
for command_, func_ in get_commands(cls).items():
|
||||||
proccess_decorators("_cmd_doc_")
|
proccess_decorators("_cmd_doc_", command_)
|
||||||
try:
|
try:
|
||||||
func_.__doc__ = self.strings[f"_cmd_doc_{command_}"]
|
func_.__doc__ = self.strings[f"_cmd_doc_{command_}"]
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
func_.__func__.__doc__ = self.strings[f"_cmd_doc_{command_}"]
|
func_.__func__.__doc__ = self.strings[f"_cmd_doc_{command_}"]
|
||||||
|
|
||||||
for inline_handler_, func_ in get_inline_handlers(cls).items():
|
for inline_handler_, func_ in get_inline_handlers(cls).items():
|
||||||
proccess_decorators("_ihandle_doc_")
|
proccess_decorators("_ihandle_doc_", inline_handler_)
|
||||||
try:
|
try:
|
||||||
func_.__doc__ = self.strings[f"_ihandle_doc_{inline_handler_}"]
|
func_.__doc__ = self.strings[f"_ihandle_doc_{inline_handler_}"]
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
|
Loading…
Reference in New Issue