Ejemplo n.º 1
0
 def _error_handler(self, error):
     try:
         raise error
     except NotAuthorizedError:
         # Silently ignore auth failures
         self.emit('auth-failed')
         return
     except TransactionFailed as error:
         pass
     except Exception as error:
         error = TransactionFailed(ERROR_UNKNOWN, str(error))
     dia = AptErrorDialog(error)
     dia.run()
     dia.destroy()
Ejemplo n.º 2
0
        self.emit('done', error)

    def _error_handler(self, error):
        try:
            raise error
        except NotAuthorizedError:
            # Silently ignore auth failures
            self.emit('auth-failed')
            return
        except TransactionFailed, error:
            pass
        except Exception, error:
            error = TransactionFailed(ERROR_UNKNOWN, str(error))
        dia = AptErrorDialog(error)
        dia.run()
        dia.destroy()

    def _confirm(self):
        from aptdaemon.gtkwidgets import AptConfirmDialog
        dia = AptConfirmDialog(self._transaction,
                               parent=self.parent)
        response = dia.run()
        dia.destroy()
        if response == gtk.RESPONSE_OK:
            self._install()

    def _install(self):
        def reply():
            return True
        dialog = AptProgressDialog(self._transaction,
                                   parent=self.parent)