mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-20 13:08:31 +02:00
Fix jrnl --ls crash
This commit is contained in:
parent
8fd545ac9f
commit
ee085e6d2b
1 changed files with 5 additions and 5 deletions
|
@ -23,13 +23,13 @@ def deprecated_cmd(old_cmd, new_cmd, callback=None, **kwargs):
|
||||||
callback(**kwargs)
|
callback(**kwargs)
|
||||||
|
|
||||||
|
|
||||||
def list_journals(config):
|
def list_journals(configuration):
|
||||||
from . import install
|
from . import config
|
||||||
|
|
||||||
"""List the journals specified in the configuration file"""
|
"""List the journals specified in the configuration file"""
|
||||||
result = f"Journals defined in {install.CONFIG_FILE_PATH}\n"
|
result = f"Journals defined in {config.get_config_path()}\n"
|
||||||
ml = min(max(len(k) for k in config["journals"]), 20)
|
ml = min(max(len(k) for k in configuration["journals"]), 20)
|
||||||
for journal, cfg in config["journals"].items():
|
for journal, cfg in configuration["journals"].items():
|
||||||
result += " * {:{}} -> {}\n".format(
|
result += " * {:{}} -> {}\n".format(
|
||||||
journal, ml, cfg["journal"] if isinstance(cfg, dict) else cfg
|
journal, ml, cfg["journal"] if isinstance(cfg, dict) else cfg
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue