Browse Source

update the auto alias tool

tags/v0.4.10
ChenXin 5 years ago
parent
commit
a2e3158488
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      fastNLP/doc_utils.py

+ 2
- 1
fastNLP/doc_utils.py View File

@@ -13,7 +13,8 @@ def doc_process(m):
while 1: while 1:
defined_m = sys.modules[module_name] defined_m = sys.modules[module_name]
if "undocumented" not in defined_m.__doc__ and name in defined_m.__all__: if "undocumented" not in defined_m.__doc__ and name in defined_m.__all__:
obj.__doc__ = r"定义在 :class:`" + module_name + "." + name + "`\n" + obj.__doc__
obj.__doc__ = r"别名 :class:`" + m.__name__ + "." + name + "`" \
+ " :class:`" + module_name + "." + name + "`\n" + obj.__doc__
break break
module_name = ".".join(module_name.split('.')[:-1]) module_name = ".".join(module_name.split('.')[:-1])
if module_name == m.__name__: if module_name == m.__name__:


Loading…
Cancel
Save