~ubuntu-branches/ubuntu/raring/pyxdg/raring-proposed

« back to all changes in this revision

Viewing changes to xdg/Menu.py

  • Committer: Bazaar Package Importer
  • Author(s): Artur Rona
  • Date: 2010-01-19 00:32:35 UTC
  • mfrom: (3.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100119003235-sm7fpza2uxke2nbd
Tags: 0.18-1ubuntu1
* Merge from debian testing, remaining changes (LP: #509393):
  - gettext-support.patch: Support X-GNOME-Gettext-Domain and
    X-Ubuntu-Gettext-Domain fields in .desktop files, for dynamic
    translation support (corresponding to our glib change).

Show diffs side-by-side

added added

removed removed

Lines of Context:
498
498
        filename = __getFileName(filename)
499
499
 
500
500
    # use default if no filename given
501
 
    if not filename:
502
 
        filename = __getFileName("applications.menu")
503
 
 
504
 
    if not filename:
505
 
        raise ParsingError('File not found', "/etc/xdg/menus/applications.menu")
 
501
    if not filename: 
 
502
        candidate = os.environ.get('XDG_MENU_PREFIX', '') + "applications.menu"
 
503
        filename = __getFileName(candidate)
 
504
        
 
505
    if not filename:
 
506
        raise ParsingError('File not found', "/etc/xdg/menus/%s" % candidate)
506
507
 
507
508
    # check if it is a .menu file
508
509
    if not os.path.splitext(filename)[1] == ".menu":