From: "Diwaker Gupta" Subject: [patch] xenmon.py: add next/previous bindings to curses mode Date: Mon, 6 Mar 2006 13:20:15 -0800 Message-ID: <891be9410603061320q769d373dre986a10bfefabac@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline 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 Cycling around many CPUs in XenMon's curses mode can get cumbersome. This trivial patch adds bindings to move to the previous CPU. The next/previous binding seems more natural to me than the earlier cycle binding, but we can keep them all for now. # HG changeset patch # Node ID 146b5c76086c07fad61bea7ccf60f2f4fd66abbd # Parent 7dd31dbf16e75f0f70e0f9c44b2bb2b5fc6eecf1 Add next/previous key bindings to XenMon curses mode. Signed-off-by: Diwaker Gupta diff -r 7dd31dbf16e7 -r 146b5c76086c tools/xenmon/xenmon.py --- a/tools/xenmon/xenmon.py Mon Mar 6 13:02:50 2006 -0800 +++ b/tools/xenmon/xenmon.py Mon Mar 6 13:17:38 2006 -0800 @@ -452,6 +452,12 @@ def show_livestats(): if c =3D=3D ord('c'): cpu =3D (cpu + 1) % ncpu + # n/p =3D cycle to the next/previous CPU + if c =3D=3D ord('n'): + cpu =3D (cpu + 1) % ncpu + if c =3D=3D ord('p'): + cpu =3D (cpu - 1) % ncpu + stdscr.erase() _c.nocbreak() -- Web/Blog/Gallery: http://floatingsun.net/blog