~mvo/software-center/fedora

« back to all changes in this revision

Viewing changes to softwarecenter/db/categories.py

  • Committer: Giovanni Campagna
  • Date: 2011-12-02 14:29:01 UTC
  • Revision ID: gcampagna@src.gnome.org-20111202142901-umfd5df1ylw8iuk7
categories: allow using uninstalled

Read menu file from build/, when running uninstalled. Also, check
for file existance at all times.

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
        """ parse a application menu and return a list of Category objects """
101
101
        categories = []
102
102
        # we support multiple menu files and menu drop ins
103
 
        menu_files = [datadir+"/desktop/software-center.menu"]
 
103
        menu_files = [ datadir+"/desktop/software-center.menu" ]
104
104
        menu_files += glob.glob(datadir+"/menu.d/*.menu")
105
105
        for f in menu_files:
 
106
            if not os.path.exists(f):
 
107
                continue
106
108
            tree = ET.parse(f)
107
109
            root = tree.getroot()
108
110
            for child in root.getchildren():