mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-18 03:58:32 +02:00
Align plugin names on diagnostic
This commit is contained in:
parent
84cb67204e
commit
159ef25248
1 changed files with 10 additions and 6 deletions
|
@ -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()}")
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue