mirror of https://gitlab.com/bashrc2/epicyon
Handle empty names
parent
8d366d93e4
commit
41132b7914
|
@ -306,14 +306,17 @@ def _showLocalBox(boxName: str, startPostIndex=0, noOfPosts=10) -> None:
|
||||||
posStr = str(pos) + '.'
|
posStr = str(pos) + '.'
|
||||||
while len(posStr) < 4:
|
while len(posStr) < 4:
|
||||||
posStr += ' '
|
posStr += ' '
|
||||||
name = speakerJson['name']
|
if speakerJson.get('name'):
|
||||||
|
name = speakerJson['name']
|
||||||
|
else:
|
||||||
|
name = ''
|
||||||
name = (name[:16] + '..') if len(name) > 16 else name
|
name = (name[:16] + '..') if len(name) > 16 else name
|
||||||
while len(name) < 16:
|
while len(name) < 16:
|
||||||
name += ' '
|
name += ' '
|
||||||
content = speakerJson['content']
|
content = speakerJson['content']
|
||||||
content = (content[:40] + '..') if len(content) > 40 else content
|
content = (content[:40] + '..') if len(content) > 40 else content
|
||||||
print(posStr + ' | ' + name + ' | ' +
|
print(str(posStr) + ' | ' + str(name) + ' | ' +
|
||||||
published + ' | ' + content) + ' |'
|
str(published) + ' | ' + str(content)) + ' |'
|
||||||
print('')
|
print('')
|
||||||
|
|
||||||
|
|
||||||
|
|
2
posts.py
2
posts.py
|
@ -2144,7 +2144,7 @@ def sendPostViaServer(projectVersion: str,
|
||||||
inboxUrl, headers, debug, 60, True)
|
inboxUrl, headers, debug, 60, True)
|
||||||
if not postResult:
|
if not postResult:
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: POST failed for c2s to '+inboxUrl)
|
print('DEBUG: POST failed for c2s to ' + inboxUrl)
|
||||||
return 5
|
return 5
|
||||||
|
|
||||||
if debug:
|
if debug:
|
||||||
|
|
2
roles.py
2
roles.py
|
@ -352,7 +352,7 @@ def sendRoleViaServer(baseDir: str, session,
|
||||||
postJson(session, newRoleJson, [], inboxUrl, headers, 30, True)
|
postJson(session, newRoleJson, [], inboxUrl, headers, 30, True)
|
||||||
if not postResult:
|
if not postResult:
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: POST announce failed for c2s to '+inboxUrl)
|
print('DEBUG: POST announce failed for c2s to ' + inboxUrl)
|
||||||
# return 5
|
# return 5
|
||||||
|
|
||||||
if debug:
|
if debug:
|
||||||
|
|
Loading…
Reference in New Issue