diff options
author | Heinrich Wendel <h_wendel@cojobo.net> | 2008-03-02 13:47:54 +0000 |
---|---|---|
committer | Heinrich Wendel <h_wendel@cojobo.net> | 2008-03-02 13:47:54 +0000 |
commit | 322eaceb197ee545e577aadbecc24c390526b776 (patch) | |
tree | 7bbc8ac25f30078a0f7c23e9a69494cc75d9f764 | |
parent | 60ebf79ff7a3f221995f8f3eea96e65d389673f4 (diff) |
small fixes
-rw-r--r-- | ChangeLog | 8 | ||||
-rwxr-xr-x | test/test-desktop-write.py | 2 | ||||
-rwxr-xr-x | test/test-desktop.py | 2 | ||||
-rwxr-xr-x | test/test-icon.py | 2 | ||||
-rw-r--r-- | xdg/DesktopEntry.py | 3 | ||||
-rw-r--r-- | xdg/IniFile.py | 5 |
6 files changed, 15 insertions, 7 deletions
@@ -1,3 +1,11 @@ +Version 0.16 + +2008-03-02 Heinrich Wendel <h_wendel@cojobo.net> + * IniFile.py: Fix saving of relative filenames + * IniFile.py: Fix __cmp__ method + + + Version 0.15 2005-08-10 Heinrich Wendel <h_wendel@cojoob.net> diff --git a/test/test-desktop-write.py b/test/test-desktop-write.py index 467582e..73a7c1c 100755 --- a/test/test-desktop-write.py +++ b/test/test-desktop-write.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python from xdg.DesktopEntry import * import os, sys diff --git a/test/test-desktop.py b/test/test-desktop.py index b99313e..9409cf9 100755 --- a/test/test-desktop.py +++ b/test/test-desktop.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python from xdg.DesktopEntry import * import os, sys diff --git a/test/test-icon.py b/test/test-icon.py index 70827fe..9a23d18 100755 --- a/test/test-icon.py +++ b/test/test-icon.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python from xdg.IconTheme import * print getIconPath("opera") diff --git a/xdg/DesktopEntry.py b/xdg/DesktopEntry.py index 642f695..44f0426 100644 --- a/xdg/DesktopEntry.py +++ b/xdg/DesktopEntry.py @@ -29,9 +29,6 @@ class DesktopEntry(IniFile): def __str__(self): return self.getName() - def __cmp__(self, other): - return cmp(self, other) - def parse(self, file): IniFile.parse(self, file, ["Desktop Entry", "KDE Desktop Entry"]) diff --git a/xdg/IniFile.py b/xdg/IniFile.py index db5c00c..90093a6 100644 --- a/xdg/IniFile.py +++ b/xdg/IniFile.py @@ -21,6 +21,9 @@ class IniFile: if filename: self.parse(filename) + def __cmp__(self, other): + return cmp(self.content, other.content) + def parse(self, filename, headers): # for performance reasons content = self.content @@ -276,7 +279,7 @@ class IniFile: else: filename = self.filename - if not os.path.isdir(os.path.dirname(filename)): + if os.path.dirname(filename) and not os.path.isdir(os.path.dirname(filename)): os.makedirs(os.path.dirname(filename)) fp = codecs.open(filename, 'w') |