main
Bob Mottram 2021-06-22 13:29:17 +01:00
parent 25d0cd8c65
commit b4783c510d
6 changed files with 11 additions and 11 deletions

View File

@ -126,7 +126,7 @@ def authorizeBasic(baseDir: str, path: str, authHeader: str,
') does not match the one in the Authorization header (' +
nickname + ')')
return False
passwordFile = baseDir+'/accounts/passwords'
passwordFile = baseDir + '/accounts/passwords'
if not os.path.isfile(passwordFile):
if debug:
print('DEBUG: passwords file missing')

View File

@ -68,7 +68,7 @@ def storePersonInCache(baseDir: str, personUrl: str,
# store to file
if not allowWriteToFile:
return
if os.path.isdir(baseDir+'/cache/actors'):
if os.path.isdir(baseDir + '/cache/actors'):
cacheFilename = baseDir + '/cache/actors/' + \
personUrl.replace('/', '#')+'.json'
if not os.path.isfile(cacheFilename):

View File

@ -1532,7 +1532,7 @@ class PubServer(BaseHTTPRequestHandler):
# This produces a deterministic token based
# on nick+password+salt
saltFilename = \
baseDir+'/accounts/' + \
baseDir + '/accounts/' + \
loginNickname + '@' + domain + '/.salt'
salt = createPassword(32)
if os.path.isfile(saltFilename):
@ -1555,7 +1555,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.tokens[loginNickname] = token
loginHandle = loginNickname + '@' + domain
tokenFilename = \
baseDir+'/accounts/' + \
baseDir + '/accounts/' + \
loginHandle + '/.token'
try:
with open(tokenFilename, 'w+') as fp:

View File

@ -189,7 +189,7 @@ def validInbox(baseDir: str, nickname: str, domain: str) -> bool:
"""
if ':' in domain:
domain = domain.split(':')[0]
inboxDir = baseDir+'/accounts/' + nickname + '@' + domain + '/inbox'
inboxDir = baseDir + '/accounts/' + nickname + '@' + domain + '/inbox'
if not os.path.isdir(inboxDir):
return True
for subdir, dirs, files in os.walk(inboxDir):

View File

@ -264,8 +264,8 @@ def getSharesFeedForPerson(baseDir: str,
idStr = httpPrefix + '://' + domain + '/users/' + nickname
shares = {
'@context': 'https://www.w3.org/ns/activitystreams',
'first': idStr+'/shares?page=1',
'id': idStr+'/shares',
'first': idStr + '/shares?page=1',
'id': idStr + '/shares',
'totalItems': str(noOfShares),
'type': 'OrderedCollection'
}
@ -278,9 +278,9 @@ def getSharesFeedForPerson(baseDir: str,
idStr = httpPrefix + '://' + domain + '/users/' + nickname
shares = {
'@context': 'https://www.w3.org/ns/activitystreams',
'id': idStr+'/shares?page='+str(pageNumber),
'id': idStr + '/shares?page=' + str(pageNumber),
'orderedItems': [],
'partOf': idStr+'/shares',
'partOf': idStr + '/shares',
'totalItems': 0,
'type': 'OrderedCollectionPage'
}
@ -339,7 +339,7 @@ def sendShareViaServer(baseDir, session,
"@context": "https://www.w3.org/ns/activitystreams",
'type': 'Add',
'actor': actor,
'target': actor+'/shares',
'target': actor + '/shares',
'object': {
"type": "Offer",
"displayName": displayName,

View File

@ -1242,7 +1242,7 @@ def getPostAttachmentsAsHtml(postJsonObject: {}, boxName: str, translate: {},
galleryStr += \
' ' + replyStr + announceStr + \
likeStr + bookmarkStr + \
deleteStr + muteStr+'\n'
deleteStr + muteStr + '\n'
galleryStr += ' </div>\n'
galleryStr += ' <div class="mediaavatar">\n'
galleryStr += ' ' + avatarLink + '\n'