More debug

main
Bob Mottram 2020-05-26 17:08:30 +01:00
parent a01bc05634
commit 89e7995a33
1 changed files with 10 additions and 8 deletions

View File

@ -5420,18 +5420,18 @@ class PubServer(BaseHTTPRequestHandler):
for mType in profileMediaTypes: for mType in profileMediaTypes:
if self.server.debug: if self.server.debug:
print('DEBUG: profile update extracting ' + mType + print('DEBUG: profile update extracting ' + mType +
' image from POST') ' image or font from POST')
mediaBytes, postBytes = \ mediaBytes, postBytes = \
extractMediaInFormPOST(postBytes, boundary, mType) extractMediaInFormPOST(postBytes, boundary, mType)
if mediaBytes: if mediaBytes:
if self.server.debug: if self.server.debug:
print('DEBUG: profile update ' + mType + print('DEBUG: profile update ' + mType +
' image was found. ' + ' image or font was found. ' +
str(len(mediaBytes)) + ' bytes') str(len(mediaBytes)) + ' bytes')
else: else:
if self.server.debug: if self.server.debug:
print('DEBUG: profile update, no ' + mType + print('DEBUG: profile update, no ' + mType +
' image was found in POST') ' image or font was found in POST')
continue continue
# Note: a .temp extension is used here so that at no # Note: a .temp extension is used here so that at no
@ -5455,19 +5455,21 @@ class PubServer(BaseHTTPRequestHandler):
filenameBase) filenameBase)
if filename: if filename:
print('Profile update POST ' + mType + print('Profile update POST ' + mType +
' media filename is ' + filename) ' media or font filename is ' + filename)
else: else:
print('Profile update, no ' + mType + print('Profile update, no ' + mType +
' media filename in POST') ' media or font filename in POST')
continue continue
if self.server.debug:
print('DEBUG: POST ' + mType +
' media removing metadata')
postImageFilename = filename.replace('.temp', '') postImageFilename = filename.replace('.temp', '')
if mType == 'customFont': if mType == 'customFont':
copyfile(filename, postImageFilename) copyfile(filename, postImageFilename)
print('profile POST ' + mType +
' image or font filename ' + postImageFilename)
else: else:
if self.server.debug:
print('DEBUG: POST ' + mType +
' media removing metadata')
removeMetaData(filename, postImageFilename) removeMetaData(filename, postImageFilename)
if os.path.isfile(postImageFilename): if os.path.isfile(postImageFilename):
print('profile update POST ' + mType + print('profile update POST ' + mType +