Reduce use of non-debug pprint

main2
Bob Mottram 2019-10-29 20:23:49 +00:00
parent e585424814
commit c1da8ffe8f
5 changed files with 11 additions and 11 deletions

View File

@ -583,7 +583,7 @@ class PubServer(BaseHTTPRequestHandler):
# For like activities add a 'to' field, which is a copy of the actor within the object field # For like activities add a 'to' field, which is a copy of the actor within the object field
messageJson,toFieldExists=addToField('Like',messageJson,self.server.debug) messageJson,toFieldExists=addToField('Like',messageJson,self.server.debug)
pprint(messageJson) #pprint(messageJson)
# save the json for later queue processing # save the json for later queue processing
queueFilename = \ queueFilename = \
@ -1599,7 +1599,7 @@ class PubServer(BaseHTTPRequestHandler):
self.server.projectVersion).encode('utf-8') self.server.projectVersion).encode('utf-8')
self._set_headers('text/html',len(msg),cookie) self._set_headers('text/html',len(msg),cookie)
print('----------------------------------------------------') print('----------------------------------------------------')
pprint(repliesJson) #pprint(repliesJson)
self._write(msg) self._write(msg)
else: else:
if self._fetchAuthenticated(): if self._fetchAuthenticated():

View File

@ -225,6 +225,7 @@ def savePostToInboxQueue(baseDir: str,httpPrefix: str, \
return None return None
postDomain,postPort=getDomainFromActor(postJsonObject['actor']) postDomain,postPort=getDomainFromActor(postJsonObject['actor'])
if not postDomain: if not postDomain:
if debug:
pprint(postJsonObject) pprint(postJsonObject)
print('No post Domain in actor') print('No post Domain in actor')
return None return None

View File

@ -13,7 +13,6 @@ import os
import fileinput import fileinput
import subprocess import subprocess
import shutil import shutil
from pprint import pprint
from pathlib import Path from pathlib import Path
from Crypto.PublicKey import RSA from Crypto.PublicKey import RSA
from shutil import copyfile from shutil import copyfile

View File

@ -2475,7 +2475,7 @@ def downloadAnnounce(session,baseDir: str,httpPrefix: str,nickname: str,domain:
if not announcedJson.get('id'): if not announcedJson.get('id'):
rejectAnnounce(announceFilename) rejectAnnounce(announceFilename)
pprint(announcedJson) #pprint(announcedJson)
return None return None
if '/statuses/' not in announcedJson['id']: if '/statuses/' not in announcedJson['id']:
rejectAnnounce(announceFilename) rejectAnnounce(announceFilename)
@ -2487,11 +2487,11 @@ def downloadAnnounce(session,baseDir: str,httpPrefix: str,nickname: str,domain:
return None return None
if not announcedJson.get('type'): if not announcedJson.get('type'):
rejectAnnounce(announceFilename) rejectAnnounce(announceFilename)
pprint(announcedJson) #pprint(announcedJson)
return None return None
if announcedJson['type']!='Note': if announcedJson['type']!='Note':
rejectAnnounce(announceFilename) rejectAnnounce(announceFilename)
pprint(announcedJson) #pprint(announcedJson)
return None return None
# wrap in create to be consistent with other posts # wrap in create to be consistent with other posts
@ -2501,7 +2501,7 @@ def downloadAnnounce(session,baseDir: str,httpPrefix: str,nickname: str,domain:
announcedJson) announcedJson)
if announcedJson['type']!='Create': if announcedJson['type']!='Create':
rejectAnnounce(announceFilename) rejectAnnounce(announceFilename)
pprint(announcedJson) #pprint(announcedJson)
return None return None
# set the id to the original status # set the id to the original status

View File

@ -1785,13 +1785,13 @@ def individualPostAsHtml(iconsDir: str,translate: {}, \
titleStr+='<a href="'+messageId+'">'+displayName+'</a>' titleStr+='<a href="'+messageId+'">'+displayName+'</a>'
else: else:
if not messageId: if not messageId:
pprint(postJsonObject) #pprint(postJsonObject)
print('ERROR: no messageId') print('ERROR: no messageId')
if not actorNickname: if not actorNickname:
pprint(postJsonObject) #pprint(postJsonObject)
print('ERROR: no actorNickname') print('ERROR: no actorNickname')
if not actorDomain: if not actorDomain:
pprint(postJsonObject) #pprint(postJsonObject)
print('ERROR: no actorDomain') print('ERROR: no actorDomain')
titleStr+='<a href="'+messageId+'">@'+actorNickname+'@'+actorDomain+'</a>' titleStr+='<a href="'+messageId+'">@'+actorNickname+'@'+actorDomain+'</a>'