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

« back to all changes in this revision

Viewing changes to softwarecenter/ui/gtk3/models/appstore2.py

  • Committer: Package Import Robot
  • Author(s): Michael Vogt
  • Date: 2012-10-11 15:33:05 UTC
  • mfrom: (195.1.18 quantal)
  • Revision ID: package-import@ubuntu.com-20121011153305-fm5ln7if3rpzts4n
Tags: 5.4.1.1
* lp:~mvo/software-center/reinstall-previous-purchase-token-fix:
  - fix reinstall previous purchases that have a system-wide
    license key LP: #1065481
* lp:~mvo/software-center/lp1060106:
  - Add missing gettext init for utils/update-software-center-agent
    (LP: #1060106)

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    utf8,
37
37
    unescape,
38
38
    )
39
 
from softwarecenter.backend import get_install_backend
 
39
from softwarecenter.backend.installbackend import get_install_backend
40
40
from softwarecenter.backend.reviews import get_review_loader
41
41
from softwarecenter.paths import SOFTWARE_CENTER_ICON_CACHE_DIR
42
42
 
43
 
import softwarecenter.paths
44
43
from softwarecenter.db.categories import (
45
44
    category_subcat, category_cat, CategoriesParser)
46
45
 
106
105
        # get all categories
107
106
        cat_parser = CategoriesParser(db)
108
107
        with ExecutionTime("cat_parser.parse_applications_menu()"):
109
 
            self.all_categories = cat_parser.parse_applications_menu(
110
 
                softwarecenter.paths.APP_INSTALL_PATH)
 
108
            self.all_categories = cat_parser.parse_applications_menu()
111
109
 
112
110
        # reviews stats loader
113
111
        self.review_loader = get_review_loader(cache, db)
169
167
        if doc.available is None:
170
168
            pkgname = self.get_pkgname(doc)
171
169
            doc.available = (
172
 
                (pkgname in self.cache and self.cache[pkgname].candidate)
 
170
                (pkgname in self.cache and
 
171
                 # compare here instead of assigning .candidate to
 
172
                 # .available to avoid leaking candidates
 
173
                 self.cache[pkgname].candidate is not None)
173
174
                or self.is_purchasable(doc))
174
175
        return doc.available
175
176
 
213
214
                 GObject.markup_escape_text(appname),
214
215
                 GObject.markup_escape_text(summary))
215
216
 
216
 
    def get_price(self, doc):
217
 
        return doc.get_value(XapianValues.PRICE)
 
217
    def get_display_price(self, doc):
 
218
        app = self.db.get_application(doc)
 
219
        details = app.get_details(self.db)
 
220
        return details.price
218
221
 
219
222
    def get_icon(self, doc):
220
223
        try: