diff options
author | John Kacur <jkacur@redhat.com> | 2020-07-27 15:31:18 -0400 |
---|---|---|
committer | John Kacur <jkacur@redhat.com> | 2020-07-27 15:55:17 -0400 |
commit | ae23856ce9f46e691544717c1f4c639decc5ed59 (patch) | |
tree | ec73fe0f23bcb854786bb82e8ff2978b47228699 | |
parent | e6cc5f520a43d056b6989925c63c7aa9933ac923 (diff) | |
download | tuna-ae23856ce9f46e691544717c1f4c639decc5ed59.tar.gz |
tuna: More changes to header files in tuna/gui for gtk3
More changes to header files in tuna/gui for gtk3
Multiple imports on one line cause problems for conversion scripts
Signed-off-by: John Kacur <jkacur@redhat.com>
-rw-r--r-- | tuna/config.py | 25 | ||||
-rwxr-xr-x | tuna/gui/cpuview.py | 11 | ||||
-rwxr-xr-x | tuna/gui/irqview.py | 10 | ||||
-rwxr-xr-x | tuna/gui/procview.py | 7 | ||||
-rwxr-xr-x | tuna/gui/util.py | 6 |
5 files changed, 42 insertions, 17 deletions
diff --git a/tuna/config.py b/tuna/config.py index 019317f..e7d755c 100644 --- a/tuna/config.py +++ b/tuna/config.py @@ -1,6 +1,11 @@ -import io, os, re, fnmatch -import sys, gtk -import codecs, configparser +import io +import os +import re +import fnmatch +import sys +from gi.repository import Gtk +import codecs +import configparser from time import localtime, strftime from subprocess import Popen, PIPE, STDOUT, call TUNED_CONF="""[sysctl]\n""" @@ -69,8 +74,8 @@ class Config: f.close() return 0 except (configparser.Error, IOError): - dialog = gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR,\ - gtk.BUTTONS_OK, "%s\n%s" % \ + dialog = Gtk.MessageDialog(None, 0, Gtk.MessageType.ERROR,\ + Gtk.ButtonsType.OK, "%s\n%s" % \ (_("Corruputed config file: "), _(self.config['root']+profileName))) ret = dialog.run() dialog.destroy() @@ -113,14 +118,14 @@ class Config: f.write(self.aliasToOriginal(data[index][ind]["label"])+"="+data[index][ind]["value"]+"\n") f.close() if profile[0] != "tuna": - dialog = gtk.MessageDialog(None,gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, - gtk.MESSAGE_WARNING, gtk.BUTTONS_YES_NO, "%s%s\n%s" % \ + dialog = Gtk.MessageDialog(None,Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, + Gtk.MessageType.WARNING, Gtk.ButtonsType.YES_NO, "%s%s\n%s" % \ (_("Current active profile is: "), _(profile[0]), _("Set new created profile as current in tuned daemon?"))) ret = dialog.run() dialog.destroy() - if ret == gtk.RESPONSE_YES: + if ret == Gtk.ResponseType.YES: self.setCurrentActiveProfile() if self.currentActiveProfile()[0] != "tuna": raise RuntimeError ("%s %s\n%s" % \ @@ -129,8 +134,8 @@ class Config: _("Setting of new tuned profile failed! Check if tuned is installed and active"))) return False else: - dialog = gtk.MessageDialog(None,gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, - gtk.MESSAGE_INFO, gtk.BUTTONS_OK, _("Tuna profile is now active in tuned daemon.")) + dialog = Gtk.MessageDialog(None,Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, + Gtk.MessageType.INFO, Gtk.ButtonsType.OK, _("Tuna profile is now active in tuned daemon.")) ret = dialog.run() dialog.destroy() return True diff --git a/tuna/gui/cpuview.py b/tuna/gui/cpuview.py index 78775c0..a2bd1d9 100755 --- a/tuna/gui/cpuview.py +++ b/tuna/gui/cpuview.py @@ -1,11 +1,16 @@ # -*- python -*- # -*- coding: utf-8 -*- -import gi from functools import reduce -gi.require_version("Gtk", "3.0") -import gtk, gobject, math, os, procfs, schedutils +import gi +gi.require_version("Gtk", "3.0") +from gi.repository import Gtk +from gi.repository import GObject +import math +import os +import procfs +import schedutils from tuna import sysfs, tuna, gui def set_affinity_warning(tid, affinity): diff --git a/tuna/gui/irqview.py b/tuna/gui/irqview.py index 1478090..be43bbb 100755 --- a/tuna/gui/irqview.py +++ b/tuna/gui/irqview.py @@ -1,12 +1,18 @@ # -*- python -*- # -*- coding: utf-8 -*- -import gi from functools import reduce + +import gi gi.require_version("Gtk", "3.0") from tuna import tuna, gui -import ethtool, gobject, gtk, os, procfs, schedutils +import ethtool +from gi.repository import GObject +from gi.repository import Gtk +import os +import procfs +import schedutils class irq_druid: diff --git a/tuna/gui/procview.py b/tuna/gui/procview.py index 790bc31..62ba9cf 100755 --- a/tuna/gui/procview.py +++ b/tuna/gui/procview.py @@ -2,7 +2,12 @@ import gi gi.require_version("Gtk", "3.0") from tuna import tuna, gui -import gobject, gtk, procfs, re, schedutils +from gi.repository import GObject +from gi.repository import Gtk +import procfs +import re +import schedutils + try: import perf except: diff --git a/tuna/gui/util.py b/tuna/gui/util.py index 79c49a2..b2d0126 100755 --- a/tuna/gui/util.py +++ b/tuna/gui/util.py @@ -1,7 +1,11 @@ import gi gi.require_version("Gtk", "3.0") -import gobject, gtk, pango, procfs, schedutils +from gi.repository import GObject +from gi.repository import Gtk +from gi.repository import Pango +import procfs +import schedutils from tuna import tuna class list_store_column: |