mirror of
https://github.com/natelandau/obsidian-metadata.git
synced 2025-11-19 02:13:39 -05:00
fix: improve TOML error handing and docs for Windows paths (#31)
* fix: improve TOML error handing and documentation for Windows paths * build(linting): pash ruff v2.0.260
This commit is contained in:
@@ -319,7 +319,7 @@ class Vault:
|
||||
|
||||
return num_changed
|
||||
|
||||
def export_metadata(self, path: str, export_format: str = "csv") -> None:
|
||||
def export_metadata(self, path: str, export_format: str = "csv") -> None: # noqa: C901
|
||||
"""Write metadata to a csv file.
|
||||
|
||||
Args:
|
||||
@@ -333,7 +333,7 @@ class Vault:
|
||||
|
||||
match export_format:
|
||||
case "csv":
|
||||
with export_file.open(mode="w", encoding="UTF8") as f:
|
||||
with export_file.open(mode="w", encoding="utf-8") as f:
|
||||
writer = csv.writer(f)
|
||||
writer.writerow(["Metadata Type", "Key", "Value"])
|
||||
|
||||
@@ -361,7 +361,7 @@ class Vault:
|
||||
"tags": self.metadata.tags,
|
||||
}
|
||||
|
||||
with export_file.open(mode="w", encoding="UTF8") as f:
|
||||
with export_file.open(mode="w", encoding="utf-8") as f:
|
||||
json.dump(dict_to_dump, f, indent=4, ensure_ascii=False, sort_keys=True)
|
||||
|
||||
def export_notes_to_csv(self, path: str) -> None:
|
||||
@@ -375,7 +375,7 @@ class Vault:
|
||||
alerts.error(f"Path does not exist: {export_file.parent}")
|
||||
raise typer.Exit(code=1)
|
||||
|
||||
with export_file.open(mode="w", encoding="UTF8") as f:
|
||||
with export_file.open(mode="w", encoding="utf-8") as f:
|
||||
writer = csv.writer(f)
|
||||
writer.writerow(["path", "type", "key", "value"])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user