From: ian.campbell@citrix.com Subject: [PATCH 2 of 5] pygrub: expands tabs before displaying menus Date: Sun, 22 Nov 2009 19:15:00 -0000 Message-ID: <13311ab2b104f238a88b.1258917300@localhost.localdomain> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User Ian Campbell # Date 1258917181 0 # Node ID 13311ab2b104f238a88b3842a05d0053eb8569dc # Parent b50b4a265d3879f4c334361a433f4d23d5a65314 pygrub: expands tabs before displaying menus. Otherwise the highlighting and line length trimming does not work as expected and the display appears corrupted. Signed-off-by: Ian Campbell diff -r b50b4a265d38 -r 13311ab2b104 tools/pygrub/src/pygrub --- a/tools/pygrub/src/pygrub Sun Nov 22 19:13:01 2009 +0000 +++ b/tools/pygrub/src/pygrub Sun Nov 22 19:13:01 2009 +0000 @@ -239,7 +239,7 @@ break if y == self.selected_image: self.entry_win.attron(curses.A_REVERSE) - self.entry_win.addstr(y + 1 - self.start_image, 2, i.title.ljust(70)) + self.entry_win.addstr(y + 1 - self.start_image, 2, i.title.expandtabs().ljust(70)) if y == self.selected_image: self.entry_win.attroff(curses.A_REVERSE) self.entry_win.noutrefresh() @@ -271,7 +271,7 @@ self.entry_win.attron(curses.A_REVERSE) # trim the line - l = img.lines[idx].ljust(70) + l = img.lines[idx].expandtabs().ljust(70) if len(l) > 70: l = l[:69] + ">"