forked from indymedia/epicyon
Save to a named file
parent
672f466cf0
commit
e5e3987699
28
outbox.py
28
outbox.py
|
@ -197,20 +197,22 @@ def postMessageToOutbox(messageJson: {}, postToNickname: str,
|
||||||
|
|
||||||
# save all instance blogs to the news actor
|
# save all instance blogs to the news actor
|
||||||
if postToNickname != 'news' and outboxName == 'tlblogs':
|
if postToNickname != 'news' and outboxName == 'tlblogs':
|
||||||
blogsDir = baseDir + '/accounts/news@' + domain + '/tlblogs'
|
if '/' in savedFilename:
|
||||||
if not os.path.isdir(blogsDir):
|
savedPostId = savedFilename.split('/')[-1]
|
||||||
os.mkdir(blogsDir)
|
blogsDir = baseDir + '/accounts/news@' + domain + '/tlblogs'
|
||||||
copyfile(savedFilename, blogsDir)
|
if not os.path.isdir(blogsDir):
|
||||||
inboxUpdateIndex('tlblogs', baseDir,
|
os.mkdir(blogsDir)
|
||||||
'news@' + domain,
|
copyfile(savedFilename, blogsDir + '/' + savedPostId)
|
||||||
savedFilename, debug)
|
inboxUpdateIndex('tlblogs', baseDir,
|
||||||
|
'news@' + domain,
|
||||||
|
savedFilename, debug)
|
||||||
|
|
||||||
# clear the citations file if it exists
|
# clear the citations file if it exists
|
||||||
citationsFilename = \
|
citationsFilename = \
|
||||||
baseDir + '/accounts/' + \
|
baseDir + '/accounts/' + \
|
||||||
postToNickname + '@' + domain + '/.citations.txt'
|
postToNickname + '@' + domain + '/.citations.txt'
|
||||||
if os.path.isfile(citationsFilename):
|
if os.path.isfile(citationsFilename):
|
||||||
os.remove(citationsFilename)
|
os.remove(citationsFilename)
|
||||||
|
|
||||||
if messageJson['type'] == 'Create' or \
|
if messageJson['type'] == 'Create' or \
|
||||||
messageJson['type'] == 'Question' or \
|
messageJson['type'] == 'Question' or \
|
||||||
|
|
Loading…
Reference in New Issue