diff options
author | Guy Streeter <streeter@redhat.com> | 2010-05-10 18:12:41 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-05-10 18:12:41 -0300 |
commit | 7210b5390137323a18ca6eeda00aa73318f743f9 (patch) | |
tree | 133dc108095ebe7bbe4ba7279b1cec1277727040 | |
parent | f2bc41569d3f9834e574cd9c9147d977e018d277 (diff) | |
download | tuna-7210b5390137323a18ca6eeda00aa73318f743f9.tar.gz |
gui: fix use of cpu ranges
This version makes sure that if you use the '0x' form, it's the first thing on
the line. We shouldn't allow mixing a bitmask and a list.
Patch taken from https://bugzilla.redhat.com/show_bug.cgi?id=574950
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rwxr-xr-x | tuna/gui/util.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tuna/gui/util.py b/tuna/gui/util.py index 7c01a14..eeb7616 100755 --- a/tuna/gui/util.py +++ b/tuna/gui/util.py @@ -1,7 +1,8 @@ import pygtk pygtk.require("2.0") -import gobject, gtk, pango, procfs, schedutils, tuna +import gobject, gtk, pango, procfs, schedutils +from tuna import tuna class list_store_column: def __init__(self, name, type = gobject.TYPE_UINT): @@ -36,7 +37,7 @@ def on_affinity_text_changed(self): try: new_affinity = tuna.cpustring_to_list(new_affinity_text) except: - if len(new_affinity_text) > 0 and new_affinity_text[-1] != "-": + if len(new_affinity_text) > 0 and new_affinity_text[-1] != '-' and new_affinity_text[0:2] not in ('0x', '0X'): # print "not a hex number" self.affinity.set_text(self.affinity_text) return |