diff --git a/notifications_client.py b/notifications_client.py index 3742635f9..5622bc206 100644 --- a/notifications_client.py +++ b/notifications_client.py @@ -306,14 +306,17 @@ def _showLocalBox(boxName: str, startPostIndex=0, noOfPosts=10) -> None: posStr = str(pos) + '.' while len(posStr) < 4: posStr += ' ' - name = speakerJson['name'] + if speakerJson.get('name'): + name = speakerJson['name'] + else: + name = '' name = (name[:16] + '..') if len(name) > 16 else name while len(name) < 16: name += ' ' content = speakerJson['content'] content = (content[:40] + '..') if len(content) > 40 else content - print(posStr + ' | ' + name + ' | ' + - published + ' | ' + content) + ' |' + print(str(posStr) + ' | ' + str(name) + ' | ' + + str(published) + ' | ' + str(content)) + ' |' print('') diff --git a/posts.py b/posts.py index e6937f5f1..6636a9c17 100644 --- a/posts.py +++ b/posts.py @@ -2144,7 +2144,7 @@ def sendPostViaServer(projectVersion: str, inboxUrl, headers, debug, 60, True) if not postResult: if debug: - print('DEBUG: POST failed for c2s to '+inboxUrl) + print('DEBUG: POST failed for c2s to ' + inboxUrl) return 5 if debug: diff --git a/roles.py b/roles.py index 3569159d6..7af860db5 100644 --- a/roles.py +++ b/roles.py @@ -352,7 +352,7 @@ def sendRoleViaServer(baseDir: str, session, postJson(session, newRoleJson, [], inboxUrl, headers, 30, True) if not postResult: if debug: - print('DEBUG: POST announce failed for c2s to '+inboxUrl) + print('DEBUG: POST announce failed for c2s to ' + inboxUrl) # return 5 if debug: