Em Wed, Apr 29, 2015 at 10:46:36AM -0400, John Kacur escreveu:
Assuming that this is untested though?
Tested, on a RHEL7 system, and that leads to another problem, where the
fact that there is nothing in /etc/tuna/ generates a messageDialog()
saying that the config file is "corrupted", which is not the case, it
should just start with default values, etc.
But that is for another patch. Trying to figure out how to do that, as
this was done by somobody else, using some ConfigParser() python classes
I am not familiar with.
To repro the problem, just run tuna, as root, on a system with nothing
on /etc/tuna/, it should produce the Dialog, and will freeze the screen,
with nothing on the tuna panes, till the user presses Ok.
- Arnaldo
----- Original Message -----
> We should 'import gtk', not 'import pygtk', fixes bugs when the
error
> paths try to use gtk.messageDialog():
>
> [root@ssdandy tuna]# tuna
> Traceback (most recent call last):
> File "/home/acme/git/tuna/tuna-cmd.py", line 654, in <module>
> main()
> File "/home/acme/git/tuna/tuna-cmd.py", line 648, in main
> app = tuna_gui.main_gui(kthreads, uthreads, cpus_filtered)
> File "/home/acme/git/tuna/tuna/tuna_gui.py", line 64, in __init__
> self.profileview.init_default_file()
> File "/home/acme/git/tuna/tuna/gui/profileview.py", line 141, in
> init_default_file
> not self.config.load(self.config.config['lastfile']):
> File "/home/acme/git/tuna/tuna/config.py", line 48, in load
> if(self.tuned2Tuna(profileName) < 0):
> File "/home/acme/git/tuna/tuna/config.py", line 66, in tuned2Tuna
> dialog = gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR,\
> NameError: global name 'gtk' is not defined
> [root@ssdandy tuna]#
>
> Signed-off-by: Arnaldo Carvalho de Melo <acme(a)redhat.com>
> ---
> tuna/config.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tuna/config.py b/tuna/config.py
> index 77cc4d800c03..7e19a28f967f 100644
> --- a/tuna/config.py
> +++ b/tuna/config.py
> @@ -1,5 +1,5 @@
> import io, os, re, fnmatch
> -import sys, pygtk
> +import sys, gtk
> import codecs, ConfigParser
> from time import localtime, strftime
> from subprocess import Popen, PIPE, STDOUT, call
> --
> 1.8.3.1
>
>