From 8c066e79b03ad4e20a9f7c4ae36a9e247b79a8eb Mon Sep 17 00:00:00 2001 From: necoro <> Date: Mon, 27 Aug 2007 07:30:38 +0000 Subject: Change to absolute_imports; Warning: definitly broken --- portato/gui/gtk/__init__.py | 16 +++++++++------- portato/gui/gtk/basic.py | 4 +++- portato/gui/gtk/exception_handling.py | 11 ++++++----- portato/gui/gtk/splash.py | 7 +++++-- portato/gui/gtk/usetips.py | 8 +++++--- portato/gui/gtk/windows.py | 31 ++++++++++++++++--------------- portato/gui/gtk/wrapper.py | 4 +++- portato/gui/gui_helper.py | 30 ++++++++++++++---------------- 8 files changed, 61 insertions(+), 50 deletions(-) (limited to 'portato/gui') 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 +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 +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 + +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 -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 +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 +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): diff --git a/portato/gui/gui_helper.py b/portato/gui/gui_helper.py index 3ed8152..0d7ecf8 100644 --- a/portato/gui/gui_helper.py +++ b/portato/gui/gui_helper.py @@ -10,27 +10,25 @@ # # Written by René 'Necoro' Neumann +from __future__ import absolute_import + +# some stuff needed +import logging +import os, pty +import signal, threading, time +from subprocess import Popen, PIPE, STDOUT + # some backend things -from portato import backend -from portato.backend import flags, system, set_system -from portato.helper import debug, info, send_signal_to_group, set_log_level, unique_array -from portato.waiting_queue import WaitingQueue -from portato import plugin +from .. import backend, plugin +from ..backend import flags, system, set_system +from ..helper import debug, info, send_signal_to_group, set_log_level, unique_array +from ..waiting_queue import WaitingQueue # parser -from portato.config_parser import ConfigParser +from ..config_parser import ConfigParser # the wrapper -from wrapper import Console, Tree - -# some stuff needed -from subprocess import Popen, PIPE, STDOUT -import threading -import pty -import time -import os -import signal -import logging +from .wrapper import Console, Tree class Config: """Wrapper around a ConfigParser and for additional local configurations.""" -- cgit v1.2.3-70-g09d2