mirror of
https://github.com/vladmandic/automatic
synced 2026-09-01 18:46:53 +02:00
fix styles path
This commit is contained in:
+3
-1
@@ -73,7 +73,9 @@ class StyleDatabase:
|
||||
|
||||
def save_styles(self, path: str) -> None:
|
||||
# Write to temporary file first, so we don't nuke the file if something goes wrong
|
||||
os.makedirs(os.path.dirname(path), exist_ok=True)
|
||||
basedir = os.path.dirname(path)
|
||||
if basedir is not None and len(basedir) > 0:
|
||||
os.makedirs(basedir, exist_ok=True)
|
||||
fd, temp_path = tempfile.mkstemp(".csv")
|
||||
with os.fdopen(fd, "w", encoding="utf-8-sig", newline='') as file:
|
||||
# _fields is actually part of the public API: typing.NamedTuple is a replacement for collections.NamedTuple,
|
||||
|
||||
Reference in New Issue
Block a user