~mpt/software-center/help-3.0

« back to all changes in this revision

Viewing changes to softwarecenter/backend/aptd.py

  • Committer: Michael Vogt
  • Date: 2010-09-06 14:32:59 UTC
  • Revision ID: michael.vogt@ubuntu.com-20100906143259-92tb9vgg2po5pwot
softwarecenter/backend/aptd.py: if the retries fail, eventually clean the pending_purchases if adding the repo failed consistently

Show diffs side-by-side

added added

removed removed

Lines of Context:
357
357
            # download it
358
358
            retry = int(trans.meta_data['sc_add_repo_and_install_try'])
359
359
            if retry > 10:
 
360
                self._clean_pending_purchases(
 
361
                    trans.meta_data['sc_add_repo_and_install_pkgname'])
360
362
                self._show_transaction_failed_dialog(trans, result)
361
363
                return
362
364
            trans.meta_data['sc_add_repo_and_install_try'] = str(retry+1)
509
511
        if trans.role == enums.ROLE_INSTALL_PACKAGES:
510
512
            self._clean_pending_purchases(pkgname)
511
513
 
512
 
 
513
514
    def _clean_pending_purchases(self, pkgname):
514
515
        if pkgname and pkgname in self.pending_purchases:
515
516
            self.pending_purchases.remove(pkgname)