From 686272c40d6f809483391cea4a63c4c99ef73719 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 5 Aug 2020 22:24:35 +0100 Subject: [PATCH] Create notes directory --- person.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/person.py b/person.py index c22487e3..08ec19f5 100644 --- a/person.py +++ b/person.py @@ -1085,8 +1085,11 @@ def setPersonNotes(baseDir: str, nickname: str, domain: str, return False if handle.startswith('@'): handle = handle[1:] - notesFilename = baseDir + '/accounts/' + \ - nickname + '@' + domain + '/notes/' + handle + '.txt' + notesDir = baseDir + '/accounts/' + \ + nickname + '@' + domain + '/notes' + if not os.path.isdir(notesDir): + os.mkdir(notesDir) + notesFilename = notesDir + '/' + handle + '.txt' with open(notesFilename, 'w+') as notesFile: notesFile.write(notes) return True