feat(configuration): support multiple vaults in the configuration file (#6)

When multiple vaults are added to the configuration file, the script will prompt 
you to select one at runtime
This commit is contained in:
Nathaniel Landau
2023-01-24 10:32:56 -05:00
committed by GitHub
parent 5abab2ad20
commit 1e4fbcb4e2
23 changed files with 350 additions and 171 deletions

View File

@@ -6,8 +6,8 @@ from typing import Any
import questionary
from rich import print
from obsidian_metadata._config import Config
from obsidian_metadata._utils import alerts, clear_screen
from obsidian_metadata._config import VaultConfig
from obsidian_metadata._utils import alerts
from obsidian_metadata._utils.alerts import logger as log
from obsidian_metadata.models import Patterns, Vault
@@ -22,7 +22,7 @@ class Application:
More info: https://questionary.readthedocs.io/en/stable/pages/advanced.html#create-questions-from-dictionaries
"""
def __init__(self, config: Config, dry_run: bool) -> None:
def __init__(self, config: VaultConfig, dry_run: bool) -> None:
self.config = config
self.dry_run = dry_run
self.custom_style = questionary.Style(
@@ -45,7 +45,6 @@ class Application:
def main_app(self) -> None: # noqa: C901
"""Questions for the main application."""
clear_screen()
self.load_vault()
while True: