From 8654023bfb70617a7c538bb7377763f39855b1e1 Mon Sep 17 00:00:00 2001 From: Eshan Ramesh Date: Wed, 27 May 2020 18:08:46 -0400 Subject: [PATCH] makedirs instead of mkdir and stderr printing --- jrnl/EncryptedJournal.py | 4 ++-- jrnl/Journal.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jrnl/EncryptedJournal.py b/jrnl/EncryptedJournal.py index fe0716cb..3dae48e1 100644 --- a/jrnl/EncryptedJournal.py +++ b/jrnl/EncryptedJournal.py @@ -43,8 +43,8 @@ class EncryptedJournal(Journal): dirname = os.path.dirname(filename) if not os.path.exists(filename): if not os.path.isdir(dirname): - os.mkdir(dirname) - print(f"[Directory {dirname} created]") + os.makedirs(dirname) + print(f"[Directory {dirname} created]",file=sys.stderr) self.create_file(filename) self.password = util.create_password(self.name) print( diff --git a/jrnl/Journal.py b/jrnl/Journal.py index 3589fbdd..8b257eb9 100644 --- a/jrnl/Journal.py +++ b/jrnl/Journal.py @@ -77,8 +77,8 @@ class Journal: dirname = os.path.dirname(filename) if not os.path.exists(filename): if not os.path.isdir(dirname): - os.mkdir(dirname) - print(f"[Directory {dirname} created]") + os.makedirs(dirname) + print(f"[Directory {dirname} created]",file=sys.stderr) self.create_file(filename) print(f"[Journal '{self.name}' created at {filename}]", file=sys.stderr)