Rename function

master
Bob Mottram 2019-08-30 19:32:34 +01:00
parent 1758ca5799
commit f7d2537085
2 changed files with 4 additions and 4 deletions

View File

@ -68,11 +68,11 @@ def getAttachmentMediaType(filename: str) -> str:
return 'audio' return 'audio'
return mediaType return mediaType
def attachImage(baseDir: str,httpPrefix: str,domain: str,port: int, \ def attachMedia(baseDir: str,httpPrefix: str,domain: str,port: int, \
postJson: {},imageFilename: str, \ postJson: {},imageFilename: str, \
mediaType: str,description: str, \ mediaType: str,description: str, \
useBlurhash: bool) -> {}: useBlurhash: bool) -> {}:
"""Attaches an image to a json object post """Attaches media to a json object post
The description can be None The description can be None
Blurhash is optional, since low power systems may take a long time to calculate it Blurhash is optional, since low power systems may take a long time to calculate it
""" """

View File

@ -541,7 +541,7 @@ def createPostBase(baseDir: str,nickname: str, domain: str, port: int, \
} }
if attachImageFilename: if attachImageFilename:
newPost['object']= \ newPost['object']= \
attachImage(baseDir,httpPrefix,domain,port, \ attachMedia(baseDir,httpPrefix,domain,port, \
newPost['object'],attachImageFilename, \ newPost['object'],attachImageFilename, \
mediaType,imageDescription,useBlurhash) mediaType,imageDescription,useBlurhash)
else: else:
@ -577,7 +577,7 @@ def createPostBase(baseDir: str,nickname: str, domain: str, port: int, \
} }
if attachImageFilename: if attachImageFilename:
newPost= \ newPost= \
attachImage(baseDir,httpPrefix,domain,port, \ attachMedia(baseDir,httpPrefix,domain,port, \
newPost,attachImageFilename, \ newPost,attachImageFilename, \
mediaType,imageDescription,useBlurhash) mediaType,imageDescription,useBlurhash)
if ccUrl: if ccUrl: