Align plugin names on diagnostic

This commit is contained in:
MinchinWeb 2021-10-11 14:06:38 -06:00
parent 84cb67204e
commit 159ef25248

View file

@ -11,6 +11,7 @@ run.
Also, please note that all (non-builtin) imports should be scoped to each function to
avoid any possible overhead for these standalone commands.
"""
from itertools import chain
import platform
import sys
@ -29,20 +30,23 @@ def preconfig_diagnostic(_):
f"Python: {sys.version}\n"
f"OS: {platform.system()} {platform.release()}"
)
plugin_name_length = max(
[len(str(x)) for x in chain(IMPORT_FORMATS, EXPORT_FORMATS)]
)
print()
print("Active Plugins:")
print(" Importers:")
for importer in IMPORT_FORMATS:
importer_class = get_importer(importer)
print(
f" {importer} : {importer_class.version} from",
f"{importer_class().class_path()}",
)
print(f" {importer:{plugin_name_length}} : ", end="")
print(f"{importer_class.version} from ", end="")
print(f"{importer_class().class_path()}")
print(" Exporters:")
for exporter in EXPORT_FORMATS:
exporter_class = get_exporter(exporter)
# print(f" {exporter} : {exporter_class.version} from {exporter_class().class_path()}")
print(f" {exporter} : ", end="")
print(f" {exporter:{plugin_name_length}} : ", end="")
print(f"{exporter_class.version} from ", end="")
print(f"{exporter_class().class_path()}")