diff options
-rw-r--r-- | portato/gui/dialogs.py | 9 | ||||
-rw-r--r-- | portato/gui/exception_handling.py | 17 | ||||
-rw-r--r-- | portato/helper.py | 14 |
3 files changed, 22 insertions, 18 deletions
diff --git a/portato/gui/dialogs.py b/portato/gui/dialogs.py index edf34b7..ee65884 100644 --- a/portato/gui/dialogs.py +++ b/portato/gui/dialogs.py @@ -11,7 +11,7 @@ # Written by René 'Necoro' Neumann <necoro@necoro.net> import gtk -from ..helper import error +from ..helper import error, get_runsystem def mail_failure_dialog(e): dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, _("Mail could not be sent")) @@ -109,7 +109,12 @@ def file_chooser_dialog (title, parent): def prereq_error_dialog (e): dialog = gtk.MessageDialog(None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, _("A prerequisite for starting Portato was not matched.")) - dialog.format_secondary_text(e.message) + + msg = e.message + if get_runsystem()[0] == "Sabayon": + msg.append("\n"+_("Note that on fresh Sabayon installs or its LiveDVD/-CD, there is no portage tree existing per default. Please run 'emerge --sync'.")) + + dialog.format_secondary_text(msg) ret = dialog.run() dialog.destroy() return ret diff --git a/portato/gui/exception_handling.py b/portato/gui/exception_handling.py index 4068ad9..2e9c76c 100644 --- a/portato/gui/exception_handling.py +++ b/portato/gui/exception_handling.py @@ -18,7 +18,7 @@ import sys, traceback, os from StringIO import StringIO -from ..helper import debug, error +from ..helper import debug, error, get_runsystem from .dialogs import file_chooser_dialog, io_ex_dialog from .windows.mailinfo import MailInfoWindow from .utils import GtkThread @@ -101,22 +101,9 @@ def get_version_infos(): from ..constants import VERSION from ..backend import system - runsystem="Unknown" - - # check for sabayon first, as sabayon also has the gentoo release - for sp in ("/etc/sabayon-release", "/etc/sabayon-edition"): - if os.path.exists(sp): - with open(sp) as r: - runsystem = "Sabayon: %s" % r.readline().strip() - break - else: - if os.path.exists("/etc/gentoo-release"): - runsystem = "Gentoo" - - return "\n".join(( "Portato version: %s" % VERSION, - "System: %s" % runsystem, + "System: %s" % " ".join(get_runsystem()), "Python version: %s" % sys.version, "Used backend: %s" % system.get_version(), "pygtk: %s (using GTK+: %s)" % (convert(gtk.pygtk_version), convert(gtk.gtk_version)), diff --git a/portato/helper.py b/portato/helper.py index 1ae6264..d3fc70b 100644 --- a/portato/helper.py +++ b/portato/helper.py @@ -13,7 +13,7 @@ """ Some nice functions used in the program. """ -from __future__ import absolute_import +from __future__ import absolute_import, with_statement import os, signal, logging, grp @@ -43,6 +43,18 @@ def send_signal_to_group (sig): pgid = os.getpgrp() os.killpg(pgid, sig) +def get_runsystem (): + # check for sabayon first, as sabayon also has the gentoo release + for sp in ("/etc/sabayon-release", "/etc/sabayon-edition"): + if os.path.exists(sp): + with open(sp) as r: + return ("Sabayon", r.readline().strip()) + + if os.path.exists("/etc/gentoo-release"): + return ("Gentoo", "") + + else: return ("Unknown", "") + def paren_reduce(mystr): """ Take a string and convert all paren enclosed entities into sublists, optionally |