Create calendar file

merge-requests/30/head
Bob Mottram 2020-07-03 20:35:32 +01:00
parent f2eb75b03f
commit 5dbd2ad076
1 changed files with 9 additions and 1 deletions

View File

@ -19,7 +19,15 @@ def receivingCalendarEvents(baseDir: str, nickname: str, domain: str,
nickname + '@' + domain + '/followingCalendar.txt'
handle = followingNickname + '@' + followingDomain
if not os.path.isfile(calendarFilename):
followingFilename = baseDir + '/accounts/' + \
nickname + '@' + domain + '/following.txt'
if not os.path.isfile(followingFilename):
return False
# create a new calendar file from the following file
with open(followingFilename, 'r') as followingFile:
followingHandles = followingFile.read()
with open(calendarFilename, 'w') as fp:
fp.write(followingHandles)
return handle + '\n' in open(calendarFilename).read()