Misleading function name

main
Bob Mottram 2020-11-14 13:03:09 +00:00
parent 03df6dffae
commit 64348c5161
12 changed files with 38 additions and 38 deletions

View File

@ -10,7 +10,7 @@ import os
from datetime import datetime
from content import replaceEmojiFromTags
from webapp import getIconsDir
from webapp import getIconsWebPath
from webapp import htmlHeaderWithExternalStyle
from webapp import htmlFooter
from webapp_media import addEmbeddedElements
@ -391,7 +391,7 @@ def htmlBlogPost(authorized: bool,
None, False)
# show rss links
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
blogStr += '<p class="rssfeed">'
blogStr += '<a href="' + httpPrefix + '://' + \
@ -451,7 +451,7 @@ def htmlBlogPage(authorized: bool, session,
# show previous and next buttons
if pageNumber is not None:
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
navigateStr = '<p>'
if pageNumber > 1:
# show previous button
@ -722,7 +722,7 @@ def htmlEditBlog(mediaInstance: bool, translate: {},
print('Edit blog: json not loaded for ' + postFilename)
return None
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
editBlogText = '<p class="new-post-text">' + \
translate['Write your post text below.'] + '</p>'

View File

@ -57,7 +57,7 @@ from posts import isImageMedia
from posts import sendSignedJson
from posts import sendToFollowersThread
from webapp import individualPostAsHtml
from webapp import getIconsDir
from webapp import getIconsWebPath
from question import questionUpdateVotes
from media import replaceYouTube
from git import isGitPatch
@ -139,7 +139,7 @@ def inboxStorePostToHtmlCache(recentPostsCache: {}, maxRecentPosts: int,
if boxname != 'tlevents' and boxname != 'outbox':
boxname = 'inbox'
individualPostAsHtml(True, recentPostsCache, maxRecentPosts,
getIconsDir(baseDir), translate, pageNumber,
getIconsWebPath(baseDir), translate, pageNumber,
baseDir, session, cachedWebfingers, personCache,
nickname, domain, port, postJsonObject,
avatarUrl, True, allowDeletion,

View File

@ -14,7 +14,7 @@ from utils import locatePost
from utils import loadJson
from shares import getValidSharedItemID
from webapp_utils import getAltPath
from webapp_utils import getIconsDir
from webapp_utils import getIconsWebPath
from webapp_utils import htmlHeaderWithExternalStyle
from webapp_utils import htmlFooter
from webapp_post import individualPostAsHtml
@ -146,7 +146,7 @@ def htmlDeletePost(cssCache: {},
"""
if '/statuses/' not in messageId:
return None
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
actor = messageId.split('/statuses/')[0]
nickname = getNicknameFromActor(actor)
domain, port = getDomainFromActor(actor)

View File

@ -20,7 +20,7 @@ from happening import getCalendarEvents
from webapp_utils import htmlHeaderWithExternalStyle
from webapp_utils import htmlFooter
from webapp_utils import getAltPath
from webapp_utils import getIconsDir
from webapp_utils import getIconsWebPath
def htmlCalendarDeleteConfirm(cssCache: {}, translate: {}, baseDir: str,
@ -122,7 +122,7 @@ def htmlCalendarDay(cssCache: {}, translate: {},
calendarStr += '</caption>\n'
calendarStr += '<tbody>\n'
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
if dayEvents:
for eventPost in dayEvents:
@ -201,7 +201,7 @@ def htmlCalendar(cssCache: {}, translate: {},
httpPrefix: str, domainFull: str) -> str:
"""Show the calendar for a person
"""
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
domain = domainFull
if ':' in domainFull:
domain = domainFull.split(':')[0]

View File

@ -15,7 +15,7 @@ from webapp_utils import htmlPostSeparator
from webapp_utils import getLeftImageFile
from webapp_utils import getImageFile
from webapp_utils import headerButtonsFrontScreen
from webapp_utils import getIconsDir
from webapp_utils import getIconsWebPath
from webapp_utils import htmlHeaderWithExternalStyle
from webapp_utils import htmlFooter
from webapp_utils import getBannerFile
@ -200,7 +200,7 @@ def htmlLinksMobile(cssCache: {}, baseDir: str,
if os.path.isfile(baseDir + '/epicyon.css'):
cssFilename = baseDir + '/epicyon.css'
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
# is the user a site editor?
if nickname == 'news':

View File

@ -24,7 +24,7 @@ from webapp_utils import htmlFooter
from webapp_utils import getBannerFile
from webapp_utils import htmlPostSeparator
from webapp_utils import headerButtonsFrontScreen
from webapp_utils import getIconsDir
from webapp_utils import getIconsWebPath
def votesIndicator(totalVotes: int, positiveVoting: bool) -> str:
@ -304,7 +304,7 @@ def htmlCitations(baseDir: str, nickname: str, domain: str,
if os.path.isfile(baseDir + '/epicyon.css'):
cssFilename = baseDir + '/epicyon.css'
# iconsDir = getIconsDir(baseDir)
# iconsDir = getIconsWebPath(baseDir)
htmlStr = htmlHeaderWithExternalStyle(cssFilename)
@ -394,7 +394,7 @@ def htmlNewswireMobile(cssCache: {}, baseDir: str, nickname: str,
if os.path.isfile(baseDir + '/epicyon.css'):
cssFilename = baseDir + '/epicyon.css'
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
if nickname == 'news':
editor = False

View File

@ -10,7 +10,7 @@ import os
from utils import isPublicPostFromUrl
from utils import getNicknameFromActor
from utils import getDomainFromActor
from webapp_utils import getIconsDir
from webapp_utils import getIconsWebPath
from webapp_utils import getBannerFile
from webapp_utils import htmlHeaderWithExternalStyle
from webapp_utils import htmlFooter
@ -171,7 +171,7 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
defaultTimeline: str, newswire: {}) -> str:
"""New post screen
"""
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
replyStr = ''
showPublicOnDropdown = True

View File

@ -53,7 +53,7 @@ from webapp_utils import addEmojiToDisplayName
from webapp_utils import postContainsPublic
from webapp_utils import getContentWarningButton
from webapp_utils import getPostAttachmentsAsHtml
from webapp_utils import getIconsDir
from webapp_utils import getIconsWebPath
from webapp_utils import htmlHeaderWithExternalStyle
from webapp_utils import htmlFooter
from webapp_media import addEmbeddedElements
@ -1235,7 +1235,7 @@ def htmlIndividualPost(cssCache: {},
showPublishedDateOnly: bool) -> str:
"""Show an individual post as html
"""
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
postStr = ''
if likedBy:
likedByNickname = getNicknameFromActor(likedBy)
@ -1350,7 +1350,7 @@ def htmlPostReplies(cssCache: {},
showPublishedDateOnly: bool) -> str:
"""Show the replies to an individual post as html
"""
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
repliesStr = ''
if repliesJson.get('orderedItems'):
for item in repliesJson['orderedItems']:

View File

@ -32,7 +32,7 @@ from pgp import getPGPpubKey
from tox import getToxAddress
from webapp_utils import scheduledPostsExist
from webapp_utils import getPersonAvatarUrl
from webapp_utils import getIconsDir
from webapp_utils import getIconsWebPath
from webapp_utils import htmlHeaderWithExternalStyle
from webapp_utils import htmlFooter
from webapp_utils import addEmojiToDisplayName
@ -245,7 +245,7 @@ def htmlProfileAfterSearch(cssCache: {},
profileStr += ' </form>\n'
profileStr += '</div>\n'
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
i = 0
for item in parseUserFeed(session, outboxUrl, asHeader,
projectVersion, httpPrefix, domain):
@ -451,7 +451,7 @@ def htmlProfile(rssIconAtTop: bool,
donateSection += ' </center>\n'
donateSection += '</div>\n'
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
if not authorized:
loginButton = headerButtonsFrontScreen(translate, nickname,
'features', authorized,
@ -553,7 +553,7 @@ def htmlProfile(rssIconAtTop: bool,
profileHeaderStr += ' <tbody>\n'
profileHeaderStr += ' <tr>\n'
profileHeaderStr += ' <td valign="top" class="col-left">\n'
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
profileHeaderStr += \
getLeftColumnContent(baseDir, 'news', domainFull,
httpPrefix, translate,
@ -668,7 +668,7 @@ def htmlProfile(rssIconAtTop: bool,
if isSystemAccount(nickname):
profileFooterStr = ' </td>\n'
profileFooterStr += ' <td valign="top" class="col-right">\n'
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
profileFooterStr += \
getRightColumnContent(baseDir, 'news', domainFull,
httpPrefix, translate,
@ -699,7 +699,7 @@ def htmlProfilePosts(recentPostsCache: {}, maxRecentPosts: int,
"""Shows posts on the profile screen
These should only be public posts
"""
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
separatorStr = htmlPostSeparator(baseDir, None)
profileStr = ''
maxItems = 4
@ -754,7 +754,7 @@ def htmlProfileFollowing(translate: {}, baseDir: str, httpPrefix: str,
"""
profileStr = ''
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
if authorized and pageNumber:
if authorized and pageNumber > 1:
# page up arrow

View File

@ -21,7 +21,7 @@ from utils import searchBoxPosts
from feeds import rss2TagHeader
from feeds import rss2TagFooter
from webapp_utils import getAltPath
from webapp_utils import getIconsDir
from webapp_utils import getIconsWebPath
from webapp_utils import getImageFile
from webapp_utils import htmlHeaderWithExternalStyle
from webapp_utils import htmlFooter
@ -100,7 +100,7 @@ def htmlSearchSharedItems(cssCache: {}, translate: {},
callingDomain: str) -> str:
"""Search results for shared items
"""
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
currPage = 1
ctr = 0
sharedItemsForm = ''
@ -479,7 +479,7 @@ def htmlHashtagSearch(cssCache: {},
print('WARN: hashtag file not found ' + hashtagIndexFile)
return None
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
separatorStr = htmlPostSeparator(baseDir, None)
# check that the directory for the nickname exists
@ -878,7 +878,7 @@ def htmlHistorySearch(cssCache: {}, translate: {}, baseDir: str,
'</h5></center>'
return historySearchForm
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
separatorStr = htmlPostSeparator(baseDir, None)
# ensure that the page number is in bounds

View File

@ -14,7 +14,7 @@ from follow import followerApprovalActive
from person import isPersonSnoozed
from happening import todaysEventsCheck
from happening import thisWeeksEventsCheck
from webapp_utils import getIconsDir
from webapp_utils import getIconsWebPath
from webapp_utils import htmlPostSeparator
from webapp_utils import getBannerFile
from webapp_utils import htmlHeaderWithExternalStyle
@ -101,7 +101,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
# directory where icons are found
# This changes depending upon theme
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
separatorStr = ''
if boxName != 'tlmedia':
@ -662,7 +662,7 @@ def htmlSharesTimeline(translate: {}, pageNumber: int, itemsPerPage: int,
timelineStr = ''
if pageNumber > 1:
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
timelineStr += \
' <center>\n' + \
' <a href="' + actor + '/tlshares?page=' + \
@ -685,7 +685,7 @@ def htmlSharesTimeline(translate: {}, pageNumber: int, itemsPerPage: int,
showContactButton, showRemoveButton)
if not lastPage:
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
timelineStr += \
' <center>\n' + \
' <a href="' + actor + '/tlshares?page=' + \

View File

@ -280,7 +280,7 @@ def getPersonAvatarUrl(baseDir: str, personUrl: str, personCache: {},
return None
def getIconsDir(baseDir: str) -> str:
def getIconsWebPath(baseDir: str) -> str:
"""Returns the web path where icons exist
"""
iconsDir = 'icons'
@ -725,7 +725,7 @@ def getPostAttachmentsAsHtml(postJsonObject: {}, boxName: str, translate: {},
def htmlPostSeparator(baseDir: str, column: str) -> str:
"""Returns the html for a timeline post separator image
"""
iconsDir = getIconsDir(baseDir)
iconsDir = getIconsWebPath(baseDir)
theme = getConfigParam(baseDir, 'theme')
filename = 'separator.png'
if column: