__ACTUALLY__ fixed empty-db key errors

pull/4/head
Blake DeMarcy 2017-04-12 09:26:04 -05:00
parent 9dd5420528
commit 3afbb00cff
1 changed files with 3 additions and 2 deletions

View File

@ -489,16 +489,17 @@ class App(object):
if no_action: if no_action:
callback = ignore callback = ignore
name = urwid_rainbows("~SYSTEM", True) name = urwid_rainbows("~SYSTEM", True)
color = "0"
else: else:
callback = self.on_post callback = self.on_post
name = urwid.Text("~{}".format(self.usermap[message["author"]]["user_name"])) name = urwid.Text("~{}".format(self.usermap[message["author"]]["user_name"]))
color = str(self.usermap[message["author"]]["color"])
post = str(message["post_id"]) post = str(message["post_id"])
head = urwid.Columns([ head = urwid.Columns([
(2 + len(post), urwid.AttrMap( (2 + len(post), urwid.AttrMap(
cute_button(">" + post, callback, message), "button", "hover")), cute_button(">" + post, callback, message), "button", "hover")),
(len(name._text) + 1, urwid.AttrMap( (len(name._text) + 1, urwid.AttrMap(name, color)),
name, str(self.usermap[message["author"]]["color"]))),
urwid.AttrMap(urwid.Text(info), "dim") urwid.AttrMap(urwid.Text(info), "dim")
]) ])