diff options
| author | 2020-11-15 02:35:37 +0100 | |
|---|---|---|
| committer | 2020-11-15 03:12:58 +0100 | |
| commit | 531ee4aad5432860afa784d0c067019662b3a0fe (patch) | |
| tree | c3346810a05723abd487b290c7aa5a6867e6441d | |
| parent | Add command for clearing the cache of packages (diff) | |
Ensure packages from PRIORITY_PACKAGES are directly accessible
Some packages (currently only python) should be prioritised to others,
the previous cleanup didn't account for other packages loading before it
which resulted in duplicate symbols getting the python prefix and the
original symbols linking to most probably undesired pages
| -rw-r--r-- | bot/exts/info/doc/_cog.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bot/exts/info/doc/_cog.py b/bot/exts/info/doc/_cog.py index b2d015b89..9e4bb54ea 100644 --- a/bot/exts/info/doc/_cog.py +++ b/bot/exts/info/doc/_cog.py @@ -33,6 +33,9 @@ FORCE_PREFIX_GROUPS = ( "pdbcommand", "term", ) +PRIORITY_PACKAGES = ( + "python", +) WHITESPACE_AFTER_NEWLINES_RE = re.compile(r"(?<=\n\n)(\s+)") NOT_FOUND_DELETE_DELAY = RedirectOutput.delete_delay @@ -235,6 +238,10 @@ class DocCog(commands.Cog): self.doc_symbols[overridden_symbol] = original_symbol self.renamed_symbols.add(overridden_symbol) + elif api_package_name in PRIORITY_PACKAGES: + self.doc_symbols[f"{original_symbol.package}.{symbol}"] = original_symbol + self.renamed_symbols.add(symbol) + else: symbol = f"{api_package_name}.{symbol}" self.renamed_symbols.add(symbol) |