~mvo/software-center/fix-new-pep8

« back to all changes in this revision

Viewing changes to softwarecenter/utils.py

  • Committer: Michael Vogt
  • Date: 2012-07-19 09:29:16 UTC
  • mfrom: (2989.33.20 5.2)
  • Revision ID: michael.vogt@ubuntu.com-20120719092916-dei4mt5hhyxkqm23
merged from the 5.2 branch, resolve conflicts (many :/) and fix failing tests in test_unity_launcher_integration via setUpClass and updates to the DesktopFilepathConversionTestCase bits to use os.path.join()

Show diffs side-by-side

added added

removed removed

Lines of Context:
435
435
        if os.path.exists(installed_desktop_file_path):
436
436
            return installed_desktop_file_path
437
437
    # lastly, just try checking directly for the desktop file based on the
438
 
    # pkgname itself
 
438
    # pkgname itself for the case of for-purchase items, etc.
439
439
    if pkgname:
440
440
        installed_desktop_file_path = "/usr/share/applications/%s.desktop" %\
441
441
            pkgname
442
442
        if os.path.exists(installed_desktop_file_path):
443
443
            return installed_desktop_file_path
 
444
        # files in the extras archive have their desktop filenames prepended
 
445
        # by "extras-", so we check for that also (LP: #1012877)
 
446
        extras_desktop_file_path = ("/usr/share/applications/"
 
447
            "extras-%s.desktop" % pkgname)
 
448
        if os.path.exists(extras_desktop_file_path):
 
449
            return extras_desktop_file_path
444
450
    LOG.warn("Could not determine the installed desktop file path for "
445
451
             "app-install desktop file: '%s'" % app_install_data_file_path)
446
452
    return ""