~bkerensa/sessioninstaller/fix-for-988775

« back to all changes in this revision

Viewing changes to sessioninstaller/utils.py

  • Committer: Bazaar Package Importer
  • Author(s): Julian Andres Klode
  • Date: 2010-07-12 14:03:40 UTC
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100712140340-3c9023mv7fngwm31
Tags: upstream-0.20
ImportĀ upstreamĀ versionĀ 0.20

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
    path = os.path.join(APP_INSTALL_DATA, file_name)
47
47
    return DesktopEntry(path)
48
48
 
49
 
def get_package_desc(pkg):
 
49
def get_package_desc(pkg, summary):
50
50
    """Return a pango markup description of the package.
51
51
    If the package provides one or more applications
52
52
    use the name and comment of the applications.
53
53
    """
54
54
    markup = ""
55
55
    if axi:
56
 
        for m in axi.postlist("XP" + pkg.name):
 
56
        for m in axi.postlist("XP" + pkg):
57
57
            doc = axi.get_document(m.docid)
58
58
            for term_iter in doc.termlist():
59
59
                app = False
62
62
                        markup += "\n\n"
63
63
                    file_name = term_iter.term[3:]
64
64
                    de = _desktop_cache.setdefault(file_name, _load(file_name))
65
 
                    name = de.getName()
66
 
                    comment = de.getComment()
67
 
                    if name and comment:
68
 
                        markup += "<b>%s</b>\n%s" % (name, comment)
 
65
                    app_name = de.getName()
 
66
                    app_comment = de.getComment()
 
67
                    if app_name:
 
68
                        markup += "<b>%s</b>" % app_name
 
69
                        if app_comment:
 
70
                            markup += "\n%s" % app_comment
69
71
    if not markup:
70
 
        markup = "<b>%s</b>\n%s" % (pkg.name, pkg.summary)
 
72
        markup = "<b>%s</b>" % pkg
 
73
        if summary:
 
74
            markup += "\n%s" % summary
71
75
    return markup
72
76
 
73
77
# vim:ts=4:sw=4:et