Indentation

main
Bob Mottram 2020-09-30 21:41:33 +01:00
parent e638d4d7c5
commit 0274ed7fa6
1 changed files with 24 additions and 24 deletions

View File

@ -101,10 +101,10 @@ def getContentWarningButton(postID: str, translate: {},
content: str) -> str:
"""Returns the markup for a content warning button
"""
return '<details><summary><b>' + \
return ' <details><summary><b>' + \
translate['SHOW MORE'] + '</b></summary>' + \
'<div id="' + postID + '">' + content + \
'</div></details>'
'</div></details>\n'
def getBlogAddress(actorJson: {}) -> str:
@ -4230,7 +4230,7 @@ def individualPostAsHtml(allowDownloads: bool,
nickname, domain,
displayName, False)
titleStr += \
'<a class="imageAnchor" href="/users/' + \
' <a class="imageAnchor" href="/users/' + \
nickname + '?options=' + postActor + \
';' + str(pageNumber) + ';' + avatarUrl + messageIdStr + \
'">' + displayName + '</a>\n'
@ -4245,7 +4245,7 @@ def individualPostAsHtml(allowDownloads: bool,
# pprint(postJsonObject)
print('ERROR: no actorDomain')
titleStr += \
'<a class="imageAnchor" href="/users/' + \
' <a class="imageAnchor" href="/users/' + \
nickname + '?options=' + postActor + \
';' + str(pageNumber) + ';' + avatarUrl + messageIdStr + \
'">@' + actorNickname + '@' + actorDomain + '</a>\n'
@ -4289,20 +4289,20 @@ def individualPostAsHtml(allowDownloads: bool,
replyStr = ''
if isPublicRepeat:
replyStr += \
'<a class="imageAnchor" href="/users/' + \
' <a class="imageAnchor" href="/users/' + \
nickname + '?replyto=' + replyToLink + \
'?actor=' + postJsonObject['actor'] + \
'" title="' + translate['Reply to this post'] + '">\n'
else:
if isDM(postJsonObject):
replyStr += \
'<a class="imageAnchor" href="/users/' + nickname + \
' <a class="imageAnchor" href="/users/' + nickname + \
'?replydm=' + replyToLink + \
'?actor=' + postJsonObject['actor'] + \
'" title="' + translate['Reply to this post'] + '">\n'
else:
replyStr += \
'<a class="imageAnchor" href="/users/' + nickname + \
' <a class="imageAnchor" href="/users/' + nickname + \
'?replyfollowers=' + replyToLink + \
'?actor=' + postJsonObject['actor'] + \
'" title="' + translate['Reply to this post'] + '">\n'
@ -4333,7 +4333,7 @@ def individualPostAsHtml(allowDownloads: bool,
if isBlogPost(postJsonObject):
blogPostId = postJsonObject['object']['id']
editStr += \
'<a class="imageAnchor" href="/users/' + nickname + \
' <a class="imageAnchor" href="/users/' + nickname + \
'/tlblogs?editblogpost=' + \
blogPostId.split('/statuses/')[1] + \
'?actor=' + actorNickname + \
@ -4345,7 +4345,7 @@ def individualPostAsHtml(allowDownloads: bool,
elif isEvent:
eventPostId = postJsonObject['object']['id']
editStr += \
'<a class="imageAnchor" href="/users/' + nickname + \
' <a class="imageAnchor" href="/users/' + nickname + \
'/tlblogs?editeventpost=' + \
eventPostId.split('/statuses/')[1] + \
'?actor=' + actorNickname + \
@ -4369,7 +4369,7 @@ def individualPostAsHtml(allowDownloads: bool,
announceLink = 'unrepeatprivate'
announceTitle = translate['Undo the repeat']
announceStr = \
'<a class="imageAnchor" href="/users/' + \
' <a class="imageAnchor" href="/users/' + \
nickname + '?' + announceLink + \
'=' + postJsonObject['object']['id'] + pageNumberParam + \
'?actor=' + postJsonObject['actor'] + \
@ -4433,7 +4433,7 @@ def individualPostAsHtml(allowDownloads: bool,
likeStr += likeCountStr.replace('(', '').replace(')', '').strip()
likeStr += '</label>\n'
likeStr += \
'<a class="imageAnchor" href="/users/' + nickname + '?' + \
' <a class="imageAnchor" href="/users/' + nickname + '?' + \
likeLink + '=' + postJsonObject['object']['id'] + \
pageNumberParam + \
'?actor=' + postJsonObject['actor'] + \
@ -4466,7 +4466,7 @@ def individualPostAsHtml(allowDownloads: bool,
if timeDiff > 100:
print('TIMING INDIV ' + boxName + ' 12.6 = ' + str(timeDiff))
bookmarkStr = \
'<a class="imageAnchor" href="/users/' + nickname + '?' + \
' <a class="imageAnchor" href="/users/' + nickname + '?' + \
bookmarkLink + '=' + postJsonObject['object']['id'] + \
pageNumberParam + \
'?actor=' + postJsonObject['actor'] + \
@ -4498,7 +4498,7 @@ def individualPostAsHtml(allowDownloads: bool,
messageId.startswith(postActor))):
if '/users/' + nickname + '/' in messageId:
deleteStr = \
'<a class="imageAnchor" href="/users/' + nickname + \
' <a class="imageAnchor" href="/users/' + nickname + \
'?delete=' + messageId + pageNumberParam + \
'" title="' + translate['Delete this post'] + '">\n'
deleteStr += \
@ -4508,7 +4508,7 @@ def individualPostAsHtml(allowDownloads: bool,
else:
if not isMuted:
muteStr = \
'<a class="imageAnchor" href="/users/' + nickname + \
' <a class="imageAnchor" href="/users/' + nickname + \
'?mute=' + messageId + pageNumberParam + '?tl=' + boxName + \
'?bm=' + timelinePostBookmark + \
'" title="' + translate['Mute this post'] + '">\n'
@ -4519,7 +4519,7 @@ def individualPostAsHtml(allowDownloads: bool,
'" src="/' + iconsDir + '/mute.png"/></a>\n'
else:
muteStr = \
'<a class="imageAnchor" href="/users/' + \
' <a class="imageAnchor" href="/users/' + \
nickname + '?unmute=' + messageId + \
pageNumberParam + '?tl=' + boxName + '?bm=' + \
timelinePostBookmark + '" title="' + \
@ -4617,7 +4617,7 @@ def individualPostAsHtml(allowDownloads: bool,
replyAvatarImageInPost = \
' ' \
'<div class="timeline-avatar-reply">\n' \
'<a class="imageAnchor" ' + \
' <a class="imageAnchor" ' + \
'href="/users/' + nickname + \
'?options=' + \
announceActor + ';' + str(pageNumber) + \
@ -4627,10 +4627,10 @@ def individualPostAsHtml(allowDownloads: bool,
announceAvatarUrl + '" ' \
'title="' + translate[idx] + \
'" alt=" "' + avatarPosition + \
'/></a>\n</div>\n'
'/></a>\n </div>\n'
else:
titleStr += \
' <img loading="lazy" title="' + \
' <img loading="lazy" title="' + \
translate['announces'] + \
'" alt="' + translate['announces'] + \
'" src="/' + iconsDir + \
@ -4641,7 +4641,7 @@ def individualPostAsHtml(allowDownloads: bool,
announceDomain + '</a>\n'
else:
titleStr += \
' <img loading="lazy" title="' + \
' <img loading="lazy" title="' + \
translate['announces'] + '" alt="' + \
translate['announces'] + '" src="/' + iconsDir + \
'/repeat_inactive.png" ' + \
@ -4650,7 +4650,7 @@ def individualPostAsHtml(allowDownloads: bool,
'">@unattributed</a>\n'
else:
titleStr += \
' <img loading="lazy" title="' + translate['announces'] + \
' <img loading="lazy" title="' + translate['announces'] + \
'" alt="' + translate['announces'] + \
'" src="/' + iconsDir + \
'/repeat_inactive.png" ' + \
@ -4662,7 +4662,7 @@ def individualPostAsHtml(allowDownloads: bool,
containerClass = 'container darker'
if postJsonObject['object']['inReplyTo'].startswith(postActor):
titleStr += \
' <img loading="lazy" title="' + \
' <img loading="lazy" title="' + \
translate['replying to themselves'] + \
'" alt="' + translate['replying to themselves'] + \
'" src="/' + iconsDir + \
@ -4866,12 +4866,12 @@ def individualPostAsHtml(allowDownloads: bool,
containerClass = 'container dm'
if showIcons:
footerStr = '<div class="' + containerClassIcons + '">'
footerStr = ' <div class="' + containerClassIcons + '">\n'
footerStr += replyStr + announceStr + likeStr + bookmarkStr + \
deleteStr + muteStr + editStr
footerStr += '<a href="' + publishedLink + '" class="' + \
footerStr += ' <a href="' + publishedLink + '" class="' + \
timeClass + '">' + publishedStr + '</a>\n'
footerStr += '</div>'
footerStr += ' </div>\n'
postIsSensitive = False
if postJsonObject['object'].get('sensitive'):