Sort modules for highlighting

With this change the output will be in a predictable order on
older versions of Python (where the dictionary is not sorted
by default).

This is helpful for debugging and interpreting the progress
from the terminal.
This commit is contained in:
Peter Cock 2017-09-12 14:59:08 +01:00
parent ad41e0b25e
commit 99503bdb6c

View File

@ -146,7 +146,7 @@ def collect_pages(app):
# app.builder.info(' (%d module code pages)' %
# len(env._viewcode_modules), nonl=1)
for modname, entry in status_iterator(iteritems(env._viewcode_modules), # type: ignore
for modname, entry in status_iterator(sorted(iteritems(env._viewcode_modules)), # type: ignore
'highlighting module code... ', "blue",
len(env._viewcode_modules), # type: ignore
app.verbosity, lambda x: x[0]):