~nataliabidart/ubuntuone-control-panel/applications-woohoo

« back to all changes in this revision

Viewing changes to ubuntuone/controlpanel/gtk/gui.py

  • Committer: Natalia B. Bidart
  • Date: 2010-12-26 15:02:52 UTC
  • Revision ID: natalia.bidart@canonical.com-20101226150252-kg4432rxak3h5bw0
Handling ValueError when creating the replicationExclusion instance.

Show diffs side-by-side

added added

removed removed

Lines of Context:
921
921
    EVOCOUCH_PKG = 'evolution-couchdb'
922
922
    BOOKMARKS = _('Bookmarks (Firefox)')
923
923
    CONTACTS = _('Contacts (Evolution)')
 
924
    NO_PAIRING_RECORD = _('There is no Ubuntu One pairing record.')
924
925
 
925
926
    def __init__(self, replication_exclusion_class=None):
926
927
        UbuntuOneBin.__init__(self)
981
982
            self.install_box = None
982
983
 
983
984
        self.message.set_text(self.CHOOSE_SERVICES)
 
985
        for child in self.replications.get_children():
 
986
            self.replications.remove(child)
 
987
 
984
988
        # Unable to import 'desktopcouch.application.replication_services'
985
989
        # pylint: disable=F0401
986
990
        if self.replication_exclusion_class is None:
989
993
            self.replication_exclusion_class = u1rep.ReplicationExclusion
990
994
 
991
995
        if self.replication_service is None:
992
 
            self.replication_service = self.replication_exclusion_class()
993
 
 
994
 
        for child in self.replications.get_children():
995
 
            self.replications.remove(child)
 
996
            try:
 
997
                self.replication_service = self.replication_exclusion_class()
 
998
            except ValueError:
 
999
                logger.exception('Can not load replications:')
 
1000
                self._set_warning(self.NO_PAIRING_RECORD, self.message)
 
1001
                return
996
1002
 
997
1003
        pkg = None
998
1004
        if not self.has_bindwood: