diff options
author | Florent Le Coz <louiz@louiz.org> | 2011-12-09 13:44:38 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2012-01-26 10:05:33 +0100 |
commit | 5fe3c49d407ac77b1e8280e1148d82d0fc1b0bc3 (patch) | |
tree | ee97367192751122e4ce778f6a7b82cb9dd7fd4d | |
parent | 73e9d837110de4881cf8a2cedb517e6ee355efb5 (diff) | |
download | poezio-5fe3c49d407ac77b1e8280e1148d82d0fc1b0bc3.tar.gz poezio-5fe3c49d407ac77b1e8280e1148d82d0fc1b0bc3.tar.bz2 poezio-5fe3c49d407ac77b1e8280e1148d82d0fc1b0bc3.tar.xz poezio-5fe3c49d407ac77b1e8280e1148d82d0fc1b0bc3.zip |
/recolor random works correctly.
-rw-r--r-- | src/tabs.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tabs.py b/src/tabs.py index ab803553..37dd7a1a 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -666,17 +666,17 @@ class MucTab(ChatTab): compare_users = lambda x: x.last_talked users = list(self.users) sorted_users = sorted(users, key=compare_users, reverse=True) - if len(args) >= 1: - if args[0] == 'random': - random.shuffle(sorted_users) # search our own user, to remove it from the list for user in sorted_users: if user.nick == self.own_nick: sorted_users.remove(user) user.color = get_theme().COLOR_OWN_NICK - nb_color = len(get_theme().LIST_COLOR_NICKNAMES) + colors = list(get_theme().LIST_COLOR_NICKNAMES) + if len(args) >= 1: + if args[0] == 'random': + random.shuffle(colors) for i, user in enumerate(sorted_users): - user.color = get_theme().LIST_COLOR_NICKNAMES[i % nb_color] + user.color = colors[i % len(colors)] self.text_win.rebuild_everything(self._text_buffer) self.text_win.refresh() self.input.refresh() |