Apologies for the delay, I'll continue to blame it on $REAL_WORK ;-)

On Mon, Jul 6, 2009 at 4:50 PM, Paul Wise<[email protected]> wrote:
> Is this something that you could add to iotop Guillaume?

I was reluctant to adding an interactive UI to iotop, but since you
wrote it, I'll take it.

Here is attached your patch ported to the latest git version, and with
some changes I made:

- cut to 80 columns & misc. cosmetic fixes
- Call ThreadInfo.set_ioprio() in ProcessInfo.set_ioprio()
- Removed the unused definitions of IOPRIO_WHO_PGRP IOPRIO_WHO_USER
- Removed IoprioSetError.__str__()
- Renamed variables that conflicted with python built-ins
- Removed the ProcessInfo import in ui.py
- Removed InvalidInput(Exception) and InvalidIoprioClass(Exception)
- Prompt in bold instead of wasting a line

I have some doubt about this particular hunk in your patch:

diff --git a/iotop/ioprio.py b/iotop/ioprio.py
index 40a4dbf..e040e49 100644
--- a/iotop/ioprio.py
+++ b/iotop/ioprio.py
 def sort_key(key):
     if key[0] == '?':
-        return -ord(key[1])
+        try:
+            return -ord(key[1])
+        except IndexError:
+            return

Why do you need this change?

If your patch with my changes still looks good to you I'll take it.

-- 
Guillaume

Attachment: PATCH
Description: Binary data

Reply via email to