~ubuntu-core-dev/update-manager/main

« back to all changes in this revision

Viewing changes to UpdateManager/Core/UpdateList.py

  • Committer: Michael Terry
  • Date: 2012-12-14 23:03:19 UTC
  • Revision ID: michael.terry@canonical.com-20121214230319-vvz4wb7mht1quiws
remove last little unnecessary call to create a MessageDialog

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
import operator
30
30
import random
31
31
import subprocess
32
 
import sys
33
32
 
34
33
 
35
34
class UpdateOrigin(object):
76
75
                ["lsb_release", "-c", "-s"], universal_newlines=True).strip()
77
76
        except subprocess.CalledProcessError as e:
78
77
            print("Error in lsb_release: %s" % e)
79
 
            parent.error(_("Failed to detect distribution"),
80
 
                         _("A error '%s' occurred while checking what system "
81
 
                           "you are using.") % e)
82
 
            sys.exit(1)
 
78
            dist = None
83
79
        self.distUpgradeWouldDelete = 0
84
80
        self.pkgs = {}
85
81
        self.num_updates = 0
92
88
    def initMatcher(self, dist):
93
89
        # (origin, archive, description, importance)
94
90
        matcher_templates = [
95
 
            ("%s-security" % dist, "Ubuntu", _("Important security updates"),
96
 
             OriginsImportance.SECURITY),
97
 
            ("%s-updates" % dist, "Ubuntu", _("Recommended updates"),
98
 
             OriginsImportance.UPDATES),
99
 
            ("%s-proposed" % dist, "Ubuntu", _("Proposed updates"),
100
 
             OriginsImportance.PROPOSED),
101
 
            ("%s-backports" % dist, "Ubuntu", _("Backports"),
102
 
             OriginsImportance.BACKPORTS),
103
 
            (dist, "Ubuntu", _("Distribution updates"),
104
 
             OriginsImportance.ARCHIVE),
105
91
            (None, None, _("Other updates"), OriginsImportance.OTHER_UNKNOWN)
106
92
        ]
 
93
        if dist:
 
94
            matcher_templates += [
 
95
                ("%s-security" % dist, "Ubuntu",
 
96
                 _("Important security updates"), OriginsImportance.SECURITY),
 
97
                ("%s-updates" % dist, "Ubuntu",
 
98
                 _("Recommended updates"), OriginsImportance.UPDATES),
 
99
                ("%s-proposed" % dist, "Ubuntu",
 
100
                 _("Proposed updates"), OriginsImportance.PROPOSED),
 
101
                ("%s-backports" % dist, "Ubuntu",
 
102
                 _("Backports"), OriginsImportance.BACKPORTS),
 
103
                (dist, "Ubuntu",
 
104
                 _("Distribution updates"), OriginsImportance.ARCHIVE),
 
105
            ]
107
106
        matcher = {}
108
107
        for (origin, archive, desc, importance) in matcher_templates:
109
108
            matcher[(origin, archive)] = UpdateOrigin(desc, importance)