diff options
| author | Poommetee Ketson <poommetee@protonmail.com> | 2017-11-19 16:25:51 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-19 16:25:51 +0700 |
| commit | 0aa4765904b0aea28ccf485b2428b027a5960df4 (patch) | |
| tree | 2d5f05ec2ad9b300b6f7245507bda8e53c2b5dbb /doc | |
| parent | baaafc5829959e065d2243092baa0369ad4a7841 (diff) | |
| parent | ade4f3084cd09e4b76ea3a7801a782aa1c49a1e8 (diff) | |
| download | redot-engine-0aa4765904b0aea28ccf485b2428b027a5960df4.tar.gz | |
Merge pull request #12989 from capnm/fix_class_makerst
Fix class docs, improve error handling of the rst generator.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/tools/makerst.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py index dc015d781b..d3ddbaddca 100644 --- a/doc/tools/makerst.py +++ b/doc/tools/makerst.py @@ -7,6 +7,7 @@ import os import xml.etree.ElementTree as ET input_list = [] +cur_file = "" for arg in sys.argv[1:]: if arg.endswith(os.sep): @@ -217,7 +218,10 @@ def rstize_text(text, cclass): param = tag_text[space_pos + 1:] if param.find('.') != -1: - (class_param, method_param) = param.split('.') + ss = param.split('.') + if len(ss) > 2: + sys.exit("Bad reference: '" + param + "' in file: " + cur_file) + (class_param, method_param) = ss tag_text = ':ref:`' + class_param + '.' + method_param + '<class_' + class_param + '_' + method_param + '>`' else: tag_text = ':ref:`' + param + '<class_' + cclass + "_" + param + '>`' @@ -519,8 +523,8 @@ for path in input_list: elif os.path.isfile(path) and path.endswith('.xml'): file_list.append(path) -for file in file_list: - tree = ET.parse(file) +for cur_file in file_list: + tree = ET.parse(cur_file) doc = tree.getroot() if 'version' not in doc.attrib: |
