From 6d848e3c477d7db5ca6608b8e910eae061f991a0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 22 Aug 2019 22:24:04 +0200 Subject: [PATCH] documentation/python: minor cleanup. --- documentation/python.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/documentation/python.py b/documentation/python.py index 9ce61e6b..df2da240 100755 --- a/documentation/python.py +++ b/documentation/python.py @@ -564,29 +564,29 @@ def make_relative_name(state: State, referrer_path: List[str], name): return '.'.join(shortened_path) -def make_name_link(state: State, referrer_path: List[str], type) -> str: - if type is None: return None - assert isinstance(type, str) +def make_name_link(state: State, referrer_path: List[str], name) -> str: + if name is None: return None + assert isinstance(name, str) # Not found, return as-is. However, if the prefix is one of the # INPUT_MODULES, emit a warning to notify the user of a potentially missing # stuff from the docs. - if not type in state.name_map: + if not name in state.name_map: for module in state.config['INPUT_MODULES']: if isinstance(module, str): module_name = module else: module_name = module.__name__ - if type.startswith(module_name + '.'): - logging.warning("could not resolve a link to %s which is among INPUT_MODULES (referred from %s), possibly hidden/undocumented?", type, '.'.join(referrer_path)) + if name.startswith(module_name + '.'): + logging.warning("could not resolve a link to %s which is among INPUT_MODULES (referred from %s), possibly hidden/undocumented?", name, '.'.join(referrer_path)) break - return type + return name # Make a shorter name that's relative to the referrer but still unambiguous - relative_name = make_relative_name(state, referrer_path, type) + relative_name = make_relative_name(state, referrer_path, name) # Format the URL - entry = state.name_map[type] + entry = state.name_map[name] if entry.type == EntryType.CLASS: url = entry.url else: -- 2.30.2