Create a scheduled post index

main
Bob Mottram 2020-01-12 12:58:05 +00:00
parent 9744db2339
commit 9409f6dcc4
1 changed files with 6 additions and 1 deletions

View File

@ -564,7 +564,7 @@ def createPostBase(baseDir: str,nickname: str,domain: str,port: int, \
sensitive=True sensitive=True
if replyToJson['object'].get('summary'): if replyToJson['object'].get('summary'):
summary=replyToJson['object']['summary'] summary=replyToJson['object']['summary']
eventDateStr=None
if eventDate: if eventDate:
eventName=summary eventName=summary
if not eventName: if not eventName:
@ -720,6 +720,11 @@ def createPostBase(baseDir: str,nickname: str,domain: str,port: int, \
if schedulePost: if schedulePost:
if eventDate and eventTime: if eventDate and eventTime:
outboxName='scheduled' outboxName='scheduled'
scheduleIndexFile=baseDir+'/accounts/schedule.txt'
scheduleFile=open(scheduleIndexFile, "a+")
if scheduleFile:
scheduleFile.write(eventDateStr+' '+newPostId+'\n')
scheduleFile.close()
else: else:
print('Unable to create scheduled post without date and time values') print('Unable to create scheduled post without date and time values')
return newPost return newPost