diff options
Diffstat (limited to 'portato/gui/gtk')
-rw-r--r-- | portato/gui/gtk/__init__.py | 16 | ||||
-rw-r--r-- | portato/gui/gtk/basic.py | 4 | ||||
-rw-r--r-- | portato/gui/gtk/exception_handling.py | 11 | ||||
-rw-r--r-- | portato/gui/gtk/splash.py | 7 | ||||
-rw-r--r-- | portato/gui/gtk/usetips.py | 8 | ||||
-rw-r--r-- | portato/gui/gtk/windows.py | 31 | ||||
-rw-r--r-- | portato/gui/gtk/wrapper.py | 4 |
7 files changed, 47 insertions, 34 deletions
diff --git a/portato/gui/gtk/__init__.py b/portato/gui/gtk/__init__.py index ba49652..5a02c00 100644 --- a/portato/gui/gtk/__init__.py +++ b/portato/gui/gtk/__init__.py @@ -10,18 +10,20 @@ # # Written by René 'Necoro' Neumann <necoro@necoro.net> +from __future__ import absolute_import + from gettext import lgettext as _ -from portato import listener -from exception_handling import register_ex_handler +from ... import listener +from .exception_handling import register_ex_handler def run (): - from splash import SplashScreen + from .splash import SplashScreen try: s = SplashScreen(_("Loading Portage")) register_ex_handler() s.show() - from windows import MainWindow + from .windows import MainWindow m = MainWindow(s) s.hide() m.main() @@ -32,9 +34,9 @@ def run (): def show_ebuild (pkg): import gtk - from portato import plugin - from portato.backend import system - from windows import SearchWindow, EbuildWindow + from ... import plugin + from ...backend import system + from .windows import SearchWindow, EbuildWindow plugin.load_plugins("gtk") register_ex_handler() diff --git a/portato/gui/gtk/basic.py b/portato/gui/gtk/basic.py index 882e40a..bc96c97 100644 --- a/portato/gui/gtk/basic.py +++ b/portato/gui/gtk/basic.py @@ -10,12 +10,14 @@ # # Written by René 'Necoro' Neumann <necoro@necoro.net> +from __future__ import absolute_import + # gtk stuff import gtk import gtk.glade import gobject -from portato.constants import DATA_DIR, APP_ICON, APP, LOCALE_DIR +from ...constants import DATA_DIR, APP_ICON, APP, LOCALE_DIR gtk.glade.bindtextdomain (APP, LOCALE_DIR) gtk.glade.textdomain (APP) diff --git a/portato/gui/gtk/exception_handling.py b/portato/gui/gtk/exception_handling.py index e9d19d1..3d89560 100644 --- a/portato/gui/gtk/exception_handling.py +++ b/portato/gui/gtk/exception_handling.py @@ -11,6 +11,8 @@ # # Written by René 'Necoro' Neumann +from __future__ import absolute_import + import gtk, pango, gobject import sys, traceback @@ -18,7 +20,7 @@ from threading import Thread from gettext import lgettext as _ from StringIO import StringIO -from portato.helper import error +from ...helper import error class GtkThread (Thread): def run(self): @@ -29,10 +31,9 @@ class GtkThread (Thread): except: type, val, tb = sys.exc_info() try: - try: - sys.excepthook(type, val, tb, thread = self.getName()) - except TypeError: - raise type, val, tb # let normal thread handle it + sys.excepthook(type, val, tb, thread = self.getName()) + except TypeError: + raise type, val, tb # let normal thread handle it finally: del type, val, tb diff --git a/portato/gui/gtk/splash.py b/portato/gui/gtk/splash.py index aa4a3ea..0b9a97f 100644 --- a/portato/gui/gtk/splash.py +++ b/portato/gui/gtk/splash.py @@ -9,12 +9,15 @@ # There is NO WARRANTY, to the extent permitted by law. # # Written by René 'Necoro' Neumann <necoro@necoro.net> + +from __future__ import absolute_import + import gtk import gobject from gettext import lgettext as _ -from portato.constants import VERSION, APP_ICON -from basic import Window +from ...constants import VERSION, APP_ICON +from .basic import Window class SplashScreen (Window): diff --git a/portato/gui/gtk/usetips.py b/portato/gui/gtk/usetips.py index 2c51d88..69e9f9a 100644 --- a/portato/gui/gtk/usetips.py +++ b/portato/gui/gtk/usetips.py @@ -10,10 +10,12 @@ # # Written by René 'Necoro' Neumann <necoro@necoro.net> -from portato.backend import system -from portato.backend.flags import invert_use_flag +from __future__ import absolute_import -from TreeViewTooltips import TreeViewTooltips +from ...backend import system +from ...backend.flags import invert_use_flag + +from .TreeViewTooltips import TreeViewTooltips class UseTips (TreeViewTooltips): """This class handles the display of the so called use-tips, diff --git a/portato/gui/gtk/windows.py b/portato/gui/gtk/windows.py index d227e45..562624c 100644 --- a/portato/gui/gtk/windows.py +++ b/portato/gui/gtk/windows.py @@ -10,6 +10,8 @@ # # Written by René 'Necoro' Neumann <necoro@necoro.net> +from __future__ import absolute_import + # gtk stuff import gtk import gobject @@ -20,22 +22,21 @@ from subprocess import Popen from gettext import lgettext as _ # our backend stuff -from portato import listener -from portato.helper import * -from portato.constants import CONFIG_LOCATION, VERSION, APP_ICON -from portato.backend import flags, system -from portato.backend.exceptions import * - -# plugins -from portato import plugin +from ... import listener, plugin +from ...helper import debug, warning, error, unique_array +from ...constants import CONFIG_LOCATION, VERSION, APP_ICON +from ...backend import flags, system +from ...backend.exceptions import PackageNotFoundException, BlockedException # more GUI stuff -from portato.gui.gui_helper import Database, Config, EmergeQueue -from basic import Window, AbstractDialog, Popup -from dialogs import * -from wrapper import GtkTree, GtkConsole -from usetips import UseTips -from exception_handling import GtkThread +from ..gui_helper import Database, Config, EmergeQueue +from .basic import Window, AbstractDialog, Popup +from .wrapper import GtkTree, GtkConsole +from .usetips import UseTips +from .exception_handling import GtkThread +from .dialogs import (blocked_dialog, changed_flags_dialog, io_ex_dialog, + nothing_found_dialog, queue_not_empty_dialog, remove_deps_dialog, + remove_queue_dialog, unmask_dialog) class AboutWindow (AbstractDialog): """A window showing the "about"-informations.""" @@ -901,7 +902,7 @@ class MainWindow (Window): self.cfg.modify_external_configs() gtk.link_button_set_uri_hook(lambda btn, x: listener.send_cmd([self.cfg.get("browserCmd", section = "GUI"), btn.get_uri()])) - gtk.about_dialog_set_url_hook(lambda *args: True) # dummy - if not set link is not set as link; if link is clicked the normal uri_hook is called too - thus do not call browser here + gtk.about_dialog_set_url_hook(lambda *args: True) # dummy - if not set link is not set as link; if link is clicked the normal uuri_hook is called too - thus do not call browser here # set plugins and plugin-menu splash(_("Loading Plugins")) diff --git a/portato/gui/gtk/wrapper.py b/portato/gui/gtk/wrapper.py index 7e67eb1..a322514 100644 --- a/portato/gui/gtk/wrapper.py +++ b/portato/gui/gtk/wrapper.py @@ -10,8 +10,10 @@ # # Written by René 'Necoro' Neumann <necoro@necoro.net> +from __future__ import absolute_import + from gettext import lgettext as _ -from portato.gui.wrapper import Tree, Console +from ..wrapper import Tree, Console import vte class GtkTree (Tree): |