summaryrefslogtreecommitdiffstats
path: root/ext/stringio/depend
diff options
context:
space:
mode:
Diffstat (limited to 'ext/stringio/depend')
0 files changed, 0 insertions, 0 deletions
0 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
#
# exception.py - general exception formatting and saving
#
# Copyright (C) 2000-2012 Red Hat, Inc.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# Author(s): Chris Lumens <clumens@redhat.com>
#            David Cantrell <dcantrell@redhat.com>
#
from meh.handler import *
from meh.dump import *
import isys
import iutil
import sys
import os
import shutil
import signal
import time
from flags import flags
import kickstart
import storage.errors
from pyanaconda.constants import ROOT_PATH
from gi.repository import GLib

import logging
log = logging.getLogger("anaconda")

import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)


class AnacondaExceptionHandler(ExceptionHandler):
    def handleException(self, (ty, value, tb), obj):

        def run_handleException_on_idle(args_tuple):
            """
            Helper function with one argument only so that it can be registered
            with GLib.idle_add() to run on idle.

            @param args_tuple: ((ty, value, tb), obj)

            """

            trace, obj = args_tuple
            ty, value, tb = trace

            super(AnacondaExceptionHandler, self).handleException((ty, value, tb),
                                                                  obj)

        if issubclass(ty, storage.errors.StorageError) and value.hardware_fault:
            hw_error_msg = _("The installation was stopped due to what "
                             "seems to be a problem with your hardware. "
                             "The exact error message is:\n\n%s.\n\n "
                             "The installer will now terminate.") % str(value)
            self.intf.showError(hw_error_msg)
            sys.exit(0)
        else:
            try:
                from gi.repository import Gtk, Gdk

                # Release Gdk lock to prevent deadlocks in cases when
                # exception appeared in gdk_threaded block