Add debug

main
Bob Mottram 2020-11-05 23:05:18 +00:00
parent 0e09c7c9c5
commit 239c0f2dd2
1 changed files with 18 additions and 13 deletions

View File

@ -10910,19 +10910,20 @@ class PubServer(BaseHTTPRequestHandler):
if not fields.get('location'): if not fields.get('location'):
fields['location'] = None fields['location'] = None
# Store a file which contains the time in seconds if not citationsButtonPress:
# since epoch when an attempt to post something was made. # Store a file which contains the time in seconds
# This is then used for active monthly users counts # since epoch when an attempt to post something was made.
lastUsedFilename = \ # This is then used for active monthly users counts
self.server.baseDir + '/accounts/' + \ lastUsedFilename = \
nickname + '@' + self.server.domain + '/.lastUsed' self.server.baseDir + '/accounts/' + \
try: nickname + '@' + self.server.domain + '/.lastUsed'
lastUsedFile = open(lastUsedFilename, 'w+') try:
if lastUsedFile: lastUsedFile = open(lastUsedFilename, 'w+')
lastUsedFile.write(str(int(time.time()))) if lastUsedFile:
lastUsedFile.close() lastUsedFile.write(str(int(time.time())))
except BaseException: lastUsedFile.close()
pass except BaseException:
pass
mentionsStr = '' mentionsStr = ''
if fields.get('mentions'): if fields.get('mentions'):
@ -10967,6 +10968,7 @@ class PubServer(BaseHTTPRequestHandler):
else: else:
return -1 return -1
elif postType == 'newblog': elif postType == 'newblog':
print('citationstest: 1 ' + str(citationsButtonPress))
# citations button on newblog screen # citations button on newblog screen
if citationsButtonPress: if citationsButtonPress:
messageJson = \ messageJson = \
@ -10982,7 +10984,9 @@ class PubServer(BaseHTTPRequestHandler):
fields['message'], fields['message'],
filename, attachmentMediaType, filename, attachmentMediaType,
fields['imageDescription']) fields['imageDescription'])
print('citationstest: 2')
if messageJson: if messageJson:
print('citationstest: 3 ' + str(messageJson))
messageJson = messageJson.encode('utf-8') messageJson = messageJson.encode('utf-8')
self._set_headers('text/html', self._set_headers('text/html',
len(messageJson), len(messageJson),
@ -10990,6 +10994,7 @@ class PubServer(BaseHTTPRequestHandler):
self._write(messageJson) self._write(messageJson)
return 1 return 1
else: else:
print('citationstest: 4')
return -1 return -1
# submit button on newblog screen # submit button on newblog screen
messageJson = \ messageJson = \