mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
2f5d270c3f
commit
2cbcd4eeb2
55
posts.py
55
posts.py
|
@ -1425,31 +1425,17 @@ def createPublicPost(baseDir: str,
|
||||||
eventStatus, ticketUrl)
|
eventStatus, ticketUrl)
|
||||||
|
|
||||||
|
|
||||||
def createBlogPost(baseDir: str,
|
def _appendCitationsToBlogPost(baseDir: str,
|
||||||
nickname: str, domain: str, port: int, httpPrefix: str,
|
nickname: str, domain: str,
|
||||||
content: str, followersOnly: bool, saveToFile: bool,
|
blogJson: {}) -> None:
|
||||||
clientToServer: bool, commentsEnabled: bool,
|
"""Appends any citations to a new blog post
|
||||||
attachImageFilename: str, mediaType: str,
|
"""
|
||||||
imageDescription: str,
|
|
||||||
inReplyTo=None, inReplyToAtomUri=None, subject=None,
|
|
||||||
schedulePost=False,
|
|
||||||
eventDate=None, eventTime=None, location=None) -> {}:
|
|
||||||
blog = \
|
|
||||||
createPublicPost(baseDir,
|
|
||||||
nickname, domain, port, httpPrefix,
|
|
||||||
content, followersOnly, saveToFile,
|
|
||||||
clientToServer, commentsEnabled,
|
|
||||||
attachImageFilename, mediaType,
|
|
||||||
imageDescription,
|
|
||||||
inReplyTo, inReplyToAtomUri, subject,
|
|
||||||
schedulePost,
|
|
||||||
eventDate, eventTime, location, True)
|
|
||||||
|
|
||||||
# append citations tags, stored in a file
|
# append citations tags, stored in a file
|
||||||
citationsFilename = \
|
citationsFilename = \
|
||||||
baseDir + '/accounts/' + \
|
baseDir + '/accounts/' + \
|
||||||
nickname + '@' + domain + '/.citations.txt'
|
nickname + '@' + domain + '/.citations.txt'
|
||||||
if os.path.isfile(citationsFilename):
|
if not os.path.isfile(citationsFilename):
|
||||||
|
return
|
||||||
citationsSeparator = '#####'
|
citationsSeparator = '#####'
|
||||||
with open(citationsFilename, "r") as f:
|
with open(citationsFilename, "r") as f:
|
||||||
citations = f.readlines()
|
citations = f.readlines()
|
||||||
|
@ -1467,9 +1453,32 @@ def createBlogPost(baseDir: str,
|
||||||
"name": title,
|
"name": title,
|
||||||
"url": link
|
"url": link
|
||||||
}
|
}
|
||||||
blog['object']['tag'].append(tagJson)
|
blogJson['object']['tag'].append(tagJson)
|
||||||
|
|
||||||
return blog
|
|
||||||
|
def createBlogPost(baseDir: str,
|
||||||
|
nickname: str, domain: str, port: int, httpPrefix: str,
|
||||||
|
content: str, followersOnly: bool, saveToFile: bool,
|
||||||
|
clientToServer: bool, commentsEnabled: bool,
|
||||||
|
attachImageFilename: str, mediaType: str,
|
||||||
|
imageDescription: str,
|
||||||
|
inReplyTo=None, inReplyToAtomUri=None, subject=None,
|
||||||
|
schedulePost=False,
|
||||||
|
eventDate=None, eventTime=None, location=None) -> {}:
|
||||||
|
blogJson = \
|
||||||
|
createPublicPost(baseDir,
|
||||||
|
nickname, domain, port, httpPrefix,
|
||||||
|
content, followersOnly, saveToFile,
|
||||||
|
clientToServer, commentsEnabled,
|
||||||
|
attachImageFilename, mediaType,
|
||||||
|
imageDescription,
|
||||||
|
inReplyTo, inReplyToAtomUri, subject,
|
||||||
|
schedulePost,
|
||||||
|
eventDate, eventTime, location, True)
|
||||||
|
|
||||||
|
_appendCitationsToBlogPost(baseDir, nickname, domain, blogJson)
|
||||||
|
|
||||||
|
return blogJson
|
||||||
|
|
||||||
|
|
||||||
def createNewsPost(baseDir: str,
|
def createNewsPost(baseDir: str,
|
||||||
|
|
Loading…
Reference in New Issue