~ubuntu-branches/ubuntu/raring/software-center/raring-proposed

« back to all changes in this revision

Viewing changes to softwarecenter/distro/debian.py

  • Committer: Package Import Robot
  • Author(s): Michael Vogt
  • Date: 2012-12-06 17:30:50 UTC
  • Revision ID: package-import@ubuntu.com-20121206173050-n7mxi5fzlsvtdh9l
Tags: 5.5.2
* lp:~mvo/software-center/fix-pygobject-deprecation-warnings:
  - fix deprecation warninings with the latest python-gi
* lp:~mvo/software-center/minor-logging-fixes:
  - drop some LOG.info() messages to LOG.debug() to spam the user
    less
* lp:~mvo/software-center/trivial-close-ui-tweak:
  - hide the main window immediately when closing down
* lp:~mvo/software-center/5.4-fix-save-person-to-config:
  - This branch ensures that the "username" is saved everytime
    that the ubuntu sso whoami call is done
* lp:~mvo/software-center/use-dpkg-builddeps:
  - use dpkg-checkbuilddeps to find test-dependencies
* lp:~mvo/software-center/update-sc-cmdline-flexibility:
  - update-software-center-agent: 
    + add --target-db-path commandline
  - update-software-center: 
    + add --app-install-desktop-dir and --target-db-path commandline
* lp:~mvo/software-center/raring-pep8:
  - fixes for new pep8

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
    # screenshot handling
32
32
    SCREENSHOT_THUMB_URL = ("http://screenshots.debian.net/"
33
 
        "thumbnail/%(pkgname)s")
 
33
                            "thumbnail/%(pkgname)s")
34
34
    SCREENSHOT_LARGE_URL = ("http://screenshots.debian.net/"
35
 
        "screenshot/%(pkgname)s")
 
35
                            "screenshot/%(pkgname)s")
36
36
    # the json description of the available screenshots
37
37
    SCREENSHOT_JSON_URL = "http://screenshots.debian.net/json/package/%s"
38
38
 
58
58
            if cache[m].section == "metapackages":
59
59
                primary = _("If you uninstall %s, future updates will not "
60
60
                            "include new items in <b>%s</b> set. "
61
 
                            "Are you sure you want to continue?") % (appname,
62
 
                            cache[m].installed.summary)
 
61
                            "Are you sure you want to continue?") % (
 
62
                                appname, cache[m].installed.summary)
63
63
                button_text = _("Remove Anyway")
64
64
                depends = []
65
65
                break
68
68
        for m in self.IMPORTANT_METAPACKAGES:
69
69
            if m in depends:
70
70
                primary = _("%s is a core application in Debian. "
71
 
                              "Uninstalling it may cause future upgrades "
72
 
                              "to be incomplete. Are you sure you want to "
73
 
                              "continue?") % appname
 
71
                            "Uninstalling it may cause future upgrades "
 
72
                            "to be incomplete. Are you sure you want to "
 
73
                            "continue?") % appname
74
74
                button_text = _("Remove Anyway")
75
75
                depends = None
76
76
                break
91
91
 
92
92
    def get_foreign_architectures(self):
93
93
        import subprocess
94
 
        out = subprocess.Popen(['dpkg', '--print-foreign-architectures'],
95
 
              stdout=subprocess.PIPE).communicate()[0].rstrip('\n')
 
94
        out = subprocess.Popen(
 
95
            ['dpkg', '--print-foreign-architectures'],
 
96
            stdout=subprocess.PIPE).communicate()[0].rstrip('\n')
96
97
        if out:
97
98
            return out.split(' ')
98
99
        return []
103
104
        if pkgname in cache and cache[pkgname].candidate:
104
105
            for origin in cache[pkgname].candidate.origins:
105
106
                if (origin.origin == "Debian" and
106
 
                    origin.trusted and
107
 
                    origin.component == "main"):
 
107
                        origin.trusted and
 
108
                        origin.component == "main"):
108
109
                    return True
109
110
        return False
110
111
 
111
112
    def get_maintenance_status(self, cache, appname, pkgname, component,
112
 
        channelname):
 
113
                               channelname):
113
114
        """Return the maintenance status of a package."""
114
115
        if not hasattr(cache, '_cache') or not pkgname:
115
116
            return
157
158
if __name__ == "__main__":
158
159
    cache = apt.Cache()
159
160
    print(cache.get_maintenance_status(cache, "synaptic app", "synaptic",
160
 
        "main", None))
 
161
                                       "main", None))
161
162
    print(cache.get_maintenance_status(cache, "3dchess app", "3dchess",
162
 
        "universe", None))
 
163
                                       "universe", None))