diff options
author | Friedemann Kleint <[email protected]> | 2023-12-05 09:07:14 +0100 |
---|---|---|
committer | Friedemann Kleint <[email protected]> | 2023-12-06 11:52:07 +0100 |
commit | c0329cff9d7378b8bf6a17baeb97bf5a240977fc (patch) | |
tree | f0f1f061f9239bad29840273fd630b0750954230 | |
parent | 916c7771e61c247475e5316b9dedbe9e963c671a (diff) |
Documentation: Print a warning if no URL can be found in inheritance graphs
Pick-to: 6.6
Task-number: PYSIDE-2215
Change-Id: I9d9493411f1df6110de68de29e84209e4cf2a5df
Reviewed-by: Shyamnath Premnadh <[email protected]>
-rw-r--r-- | sources/pyside6/doc/inheritance_graph.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sources/pyside6/doc/inheritance_graph.py b/sources/pyside6/doc/inheritance_graph.py index 2911b4582..e45ebb176 100644 --- a/sources/pyside6/doc/inheritance_graph.py +++ b/sources/pyside6/doc/inheritance_graph.py @@ -16,6 +16,22 @@ python inheritance_graph.py PySide6.QtWidgets PySide6.QtWidgets.QWizard """ +def format_dict(d): + """Format the URL dict for error message.""" + result = '{' + n = 0 + for k, v in d.items(): + n += 1 + if n > 10: + result += "..." + break + if n > 1: + result += ", " + result += f'"{k}": "{v}"' + result += '}' + return result + + class InheritanceGraph(object): """ Given a list of classes, determines the set of classes that they inherit @@ -104,6 +120,10 @@ class InheritanceGraph(object): if url is not None: this_node_attrs['URL'] = f'"{url}"' this_node_attrs['target'] = '"_top"' # Browser target frame attribute (same page) + else: + urls_str = format_dict(urls) + print(f'inheritance_graph.py: No URL found for {name} ({fullname}) in {urls_str}.', + file=sys.stderr) attribute = self._format_node_attrs(this_node_attrs) res.append(f' "{name}" [{attribute}];\n') |