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) + '.'
|
||||
while len(posStr) < 4:
|
||||
posStr += ' '
|
||||
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('')
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue