From 2ad278fa6daf640038b637dcf4b793ba71317f11 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Mon, 27 Sep 2010 21:56:42 +0200 Subject: little fixes --- module/ConfigParser.py | 15 ++++++++------- module/FileDatabase.py | 4 ++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/module/ConfigParser.py b/module/ConfigParser.py index 714e34ca9..81be6c021 100644 --- a/module/ConfigParser.py +++ b/module/ConfigParser.py @@ -123,13 +123,14 @@ class ConfigParser: listmode = False for line in config: - - line = line.rpartition("#") # removes comments - - if line[1]: - line = line[0] - else: - line = line[2] + + comment = line.rfind("#") + if line.find(":", comment) < 0 and line.find("=", comment) < 0: + line = line.rpartition("#") # removes comments + if line[1]: + line = line[0] + else: + line = line[2] line = line.strip() diff --git a/module/FileDatabase.py b/module/FileDatabase.py index 9064d5a03..4f1c1a541 100644 --- a/module/FileDatabase.py +++ b/module/FileDatabase.py @@ -183,6 +183,10 @@ class FileHandler: """delete package and all contained links""" p = self.getPackage(id) + + if not p: + return + e = RemoveEvent("pack", id, "collector" if not p.queue else "queue") pyfiles = self.cache.values() -- cgit v1.2.3