diff options
author | Heinrich Wendel <h_wendel@cojobo.net> | 2005-09-24 13:42:20 +0000 |
---|---|---|
committer | Heinrich Wendel <h_wendel@cojobo.net> | 2005-09-24 13:42:20 +0000 |
commit | 1e41d8e0244bbe16d8d34b3d93cc952002c22ff7 (patch) | |
tree | a69c508ecf7602b5bbe7d6604efa9af8c40e1244 | |
parent | 0b86a693912718a0641e25d40dd38a94ebf36873 (diff) |
small fixes
-rw-r--r-- | INSTALL | 3 | ||||
-rw-r--r-- | MANIFEST | 1 | ||||
-rw-r--r-- | setup.py | 2 | ||||
-rwxr-xr-x | test/test-menu.py | 4 | ||||
-rw-r--r-- | xdg/IniFile.py | 2 | ||||
-rw-r--r-- | xdg/Menu.py | 10 |
6 files changed, 18 insertions, 4 deletions
@@ -0,0 +1,3 @@ +Quite easy, just run: + +python setup.py install @@ -1,6 +1,7 @@ AUTHORS ChangeLog COPYING +INSTALL README TODO setup.py @@ -1,4 +1,4 @@ -#!/usr/bim/env python +#!/usr/bin/env python from distutils.core import setup diff --git a/test/test-menu.py b/test/test-menu.py index 9afe25a..cca7cb9 100755 --- a/test/test-menu.py +++ b/test/test-menu.py @@ -20,5 +20,7 @@ def show_menu(menu, depth = 0): # print depth*"-" + "\x1b[01m" + entry.Name + "\x1b[0m" # depth -= 1 -show_menu(xdg.Menu.parse()) +menu = xdg.Menu.parse() +print "hallo" +show_menu(menu) #xdg.Menu.parse() diff --git a/xdg/IniFile.py b/xdg/IniFile.py index bb37249..db5c00c 100644 --- a/xdg/IniFile.py +++ b/xdg/IniFile.py @@ -1,5 +1,7 @@ """ Base Class for DesktopEntry, IconTheme and IconData + +TODO: parse string """ import re, os.path, codecs diff --git a/xdg/Menu.py b/xdg/Menu.py index 32d4083..03a933a 100644 --- a/xdg/Menu.py +++ b/xdg/Menu.py @@ -775,9 +775,15 @@ def __mergeFile(filename, child, parent): try: doc = xml.dom.minidom.parse(filename) except IOError: - raise ParsingError('File not found', filename) + if debug: + raise ParsingError('File not found', filename) + else: + return except xml.parsers.expat.ExpatError: - raise ParsingError('Not a valid .menu file', filename) + if debug: + raise ParsingError('Not a valid .menu file', filename) + else: + return # append file for child in doc.childNodes: |