summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Kacur <jkacur@redhat.com>2020-09-21 23:46:38 -0400
committerJohn Kacur <jkacur@redhat.com>2020-09-21 23:46:38 -0400
commitfaa53c3eacfb15ae283f176d6040e7220acafa23 (patch)
tree6ef9433637e1009131cd17c38ef93bd51f4e8a6b
parent0c12c6155f076cdad30af5e13fd9fe61edd3edf8 (diff)
downloadtuna-faa53c3eacfb15ae283f176d6040e7220acafa23.tar.gz
tuna: cpuview.py: box.pack_start needs extra parameter
- Fix some white space issues. - fix box.pack_start to add a paramter - comment out some lines in around the fame.size_request to get things working. May require some more exact fixes later. Signed-off-by: John Kacur <jkacur@redhat.com>
-rwxr-xr-xtuna/gui/cpuview.py33
1 files changed, 18 insertions, 15 deletions
diff --git a/tuna/gui/cpuview.py b/tuna/gui/cpuview.py
index bcb8467..4915ce4 100755
--- a/tuna/gui/cpuview.py
+++ b/tuna/gui/cpuview.py
@@ -3,21 +3,21 @@
from functools import reduce
+import math
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
+from gi.repository import Gdk
from gi.repository import GObject
-import math
-import os
-import procfs
import schedutils
+import procfs
from tuna import sysfs, tuna, gui
def set_affinity_warning(tid, affinity):
- dialog = Gtk.MessageDialog(None,
- Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT,
- Gtk.MessageType.WARNING,
- Gtk.ButtonsType.OK,
+ dialog = Gtk.MessageDialog(None, \
+ Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, \
+ Gtk.MessageType.WARNING, \
+ Gtk.ButtonsType.OK, \
_("Couldn't change the affinity of %(tid)d to %(affinity)s!") % \
{"tid": tid, "affinity": affinity})
dialog.run()
@@ -82,7 +82,7 @@ class cpu_socket_frame(Gtk.Frame):
except:
# CellRendererProgress needs pygtk2 >= 2.6
column = Gtk.TreeViewColumn(_('Usage'), Gtk.CellRendererText(),
- text=self.COL_USAGE)
+ text=self.COL_USAGE)
self.treeview.append_column(column)
self.add(self.treeview)
self.treeview.enable_model_drag_dest(gui.DND_TARGETS,
@@ -96,8 +96,8 @@ class cpu_socket_frame(Gtk.Frame):
self.creator.procview),
"irq": (drop_handler_move_irqs_to_cpu, self.creator.irqview),}
- self.drag_dest_set(Gtk.DestDefaults.ALL, gui.DND_TARGETS,
- Gdk.DragAction.DEFAULT | Gdk.DragAction.MOVE)
+ #self.drag_dest_set(Gtk.DestDefaults.ALL, gui.DND_TARGETS,
+ # Gdk.DragAction.DEFAULT | Gdk.DragAction.MOVE)
self.connect("drag_data_received",
self.on_frame_drag_data_received_data)
@@ -276,7 +276,7 @@ class cpuview:
for socket_id in socket_ids:
frame = cpu_socket_frame(socket_id,
self.cpus.sockets[str(socket_id)], self)
- box.pack_start(frame, False, False)
+ box.pack_start(frame, False, False, 0)
self.socket_frames[socket_id] = frame
if self.nr_sockets > 1:
if column == columns:
@@ -294,11 +294,14 @@ class cpuview:
self.previous_pid_affinities = None
self.previous_irq_affinities = None
- req = frame.size_request()
+ #req = frame.size_request()
+ req = frame.get_preferred_size()
# FIXME: what is the slack we have
# to add to every row and column?
- width = req[0] + 16
- height = req[1] + 20
+ #width = req[0] + 16
+ width = 16
+ #height = req[1] + 20
+ height = 20
if self.nr_sockets > 1:
width *= columns
height *= rows
@@ -341,7 +344,7 @@ class cpuview:
affinities = self.previous_irq_affinities
for irq in list(affinities.keys()):
tuna.set_irq_affinity(int(irq),
- procfs.hexbitmask(affinities[irq],
+ procfs.hexbitmask(affinities[irq], \
self.cpus.nr_cpus))
self.previous_pid_affinities = None