From 8af5f5f5329cf3effa5ed454ea18f02286242fd6 Mon Sep 17 00:00:00 2001 From: "Rob G. Healey" Date: Sat, 12 Dec 2009 07:41:09 +0000 Subject: [PATCH] Moved "import gtk" from several different places to the area where all imports are located. Had a problem with set_header() in class progressMeter. svn: r13774 --- src/gui/utils.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/gui/utils.py b/src/gui/utils.py index 654f8b151..7f9691ebf 100644 --- a/src/gui/utils.py +++ b/src/gui/utils.py @@ -36,6 +36,7 @@ from gettext import gettext as _ # # GNOME/GTK # +import gtk #------------------------------------------------------------------------- #------------------------------------------------------------------------- @@ -56,7 +57,6 @@ def add_menuitem(menu, msg, obj, func): add a menuitem to menu with label msg, which activates func, and has data obj """ - import gtk item = gtk.MenuItem(msg) item.set_data('o', obj) item.connect("activate", func) @@ -93,7 +93,6 @@ class ProgressMeter(object): """ Specify the title and the current pass header. """ - import gtk self.__mode = ProgressMeter.MODE_FRACTION self.__pbar_max = 100.0 self.__pbar_index = 0.0 @@ -158,7 +157,6 @@ class ProgressMeter(object): Reset for another pass. Provide a new header and define number of steps to be used. """ - import gtk self.__mode = mode self.__pbar_max = total self.__pbar_index = 0.0 @@ -182,7 +180,6 @@ class ProgressMeter(object): def step(self): """Click the progress bar over to the next value. Be paranoid and insure that it doesn't go over 100%.""" - import gtk if self.__mode is ProgressMeter.MODE_FRACTION: self.__pbar_index = self.__pbar_index + 1.0