~mmcg069/software-center/sortable-app-tree-view

« back to all changes in this revision

Viewing changes to softwarecenter/backend/aptd.py

  • Committer: Matthew McGowan
  • Date: 2011-08-10 11:46:25 UTC
  • mfrom: (2050.1.1 sortable-app-tree-view)
  • Revision ID: matthew.joseph.mcgowan@gmail.com-20110810114625-b10nizwnv0p6nqj6
merge w mvo;

Show diffs side-by-side

added added

removed removed

Lines of Context:
231
231
            trans = yield self.aptd_client.fix_broken_depends(defer=True)
232
232
            self.emit("transaction-started", "", "", trans.tid, TransactionTypes.REPAIR)
233
233
            yield self._run_transaction(trans, None, None, None)
234
 
        except Exception, error:
 
234
        except Exception as error:
235
235
            self._on_trans_error(error)
236
236
 
237
237
    # FIXME: upgrade add-ons here
243
243
                                                            defer=True)
244
244
            self.emit("transaction-started", pkgname, appname, trans.tid, TransactionTypes.UPGRADE)
245
245
            yield self._run_transaction(trans, pkgname, appname, iconname, metadata)
246
 
        except Exception, error:
 
246
        except Exception as error:
247
247
            self._on_trans_error(error, pkgname)
248
248
 
249
249
# broken
280
280
                                                           defer=True)
281
281
            self.emit("transaction-started", pkgname, appname, trans.tid, TransactionTypes.REMOVE)
282
282
            yield self._run_transaction(trans, pkgname, appname, iconname, metadata)
283
 
        except Exception, error:
 
283
        except Exception as error:
284
284
            self._on_trans_error(error, pkgname)
285
285
 
286
286
    @inline_callbacks
315
315
                self.emit("transaction-started", pkgname, appname, trans.tid, TransactionTypes.INSTALL)
316
316
            yield self._run_transaction(
317
317
                trans, pkgname, appname, iconname, metadata)
318
 
        except Exception, error:
 
318
        except Exception as error:
319
319
            self._on_trans_error(error, pkgname)
320
320
 
321
321
    @inline_callbacks
340
340
                defer=True)
341
341
            self.emit("transaction-started", pkgname, appname, trans.tid, TransactionTypes.APPLY)
342
342
            yield self._run_transaction(trans, pkgname, appname, iconname)
343
 
        except Exception, error:
 
343
        except Exception as error:
344
344
            self._on_trans_error(error)
345
345
 
346
346
    @inline_callbacks
359
359
            trans = yield self.aptd_client.update_cache(
360
360
                sources_list=sources_list, defer=True)
361
361
            yield self._run_transaction(trans, None, None, None, metadata)
362
 
        except Exception, error:
 
362
        except Exception as error:
363
363
            self._on_trans_error(error)
364
364
 
365
365
    @inline_callbacks
370
370
            # don't use self._run_transaction() here, to avoid sending uneeded
371
371
            # signals
372
372
            yield trans.run(defer=True)
373
 
        except Exception, error:
 
373
        except Exception as error:
374
374
            self._on_trans_error(error, component)
375
375
            return_value(None)
376
376
        # now update the cache
409
409
            trans = yield self.aptd_client.add_vendor_key_from_keyserver(
410
410
                keyid, keyserver, defer=True)
411
411
            yield self._run_transaction(trans, None, None, None, metadata)
412
 
        except Exception, error:
 
412
        except Exception as error:
413
413
            self._on_trans_error(error)
414
414
 
415
415
    @inline_callbacks
419
419
        elif isinstance(source_entry, SourceEntry):
420
420
            entry = source_entry
421
421
        else:
422
 
            raise ValueError, "Unsupported entry type %s" % type(source_entry)
 
422
            raise ValueError("Unsupported entry type %s" % type(source_entry))
423
423
 
424
424
        if not sourcepart:
425
425
            sourcepart = sources_filename_from_ppa_entry(entry)
584
584
                self._logger.info("run_transaction()")
585
585
                yield self._run_transaction(trans, app.pkgname, app.appname,
586
586
                                            "", metadata)
587
 
            except Exception, error:
 
587
            except Exception as error:
588
588
                self._on_trans_error(error, app.pkgname)
589
589
        else:
590
590
            # download failure
784
784
            if metadata:
785
785
                yield trans.set_meta_data(defer=True, **metadata)
786
786
            yield trans.run(defer=True)
787
 
        except Exception, error:
 
787
        except Exception as error:
788
788
            self._on_trans_error(error, pkgname)
789
789
            # on error we need to clean the pending purchases
790
790
            self._clean_pending_purchases(pkgname)