[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 2 of 5] pygrub: expands tabs before displaying menus



# HG changeset patch
# User Ian Campbell <ijc@xxxxxxxxxxxxxx>
# 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 <ian.campbell@xxxxxxxxxx>

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] + ">"
                     

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.