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)
|
||||
|
||||
|
||||
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) -> {}:
|
||||
blog = \
|
||||
createPublicPost(baseDir,
|
||||
nickname, domain, port, httpPrefix,
|
||||
content, followersOnly, saveToFile,
|
||||
clientToServer, commentsEnabled,
|
||||
attachImageFilename, mediaType,
|
||||
imageDescription,
|
||||
inReplyTo, inReplyToAtomUri, subject,
|
||||
schedulePost,
|
||||
eventDate, eventTime, location, True)
|
||||
|
||||
def _appendCitationsToBlogPost(baseDir: str,
|
||||
nickname: str, domain: str,
|
||||
blogJson: {}) -> None:
|
||||
"""Appends any citations to a new blog post
|
||||
"""
|
||||
# append citations tags, stored in a file
|
||||
citationsFilename = \
|
||||
baseDir + '/accounts/' + \
|
||||
nickname + '@' + domain + '/.citations.txt'
|
||||
if os.path.isfile(citationsFilename):
|
||||
if not os.path.isfile(citationsFilename):
|
||||
return
|
||||
citationsSeparator = '#####'
|
||||
with open(citationsFilename, "r") as f:
|
||||
citations = f.readlines()
|
||||
|
@ -1467,9 +1453,32 @@ def createBlogPost(baseDir: str,
|
|||
"name": title,
|
||||
"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,
|
||||
|
|
Loading…
Reference in New Issue