From e3eae39392a1843457cd865b4a29e5c7538fd0a7 Mon Sep 17 00:00:00 2001 From: Sylvain Th?nault Date: Mon, 11 Oct 2010 09:36:40 +0200 Subject: skip comments (eg lines starting with a #) in text_to_dict --- textutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/textutils.py b/textutils.py index f83b05c..9fb59bb 100644 --- a/textutils.py +++ b/textutils.py @@ -286,7 +286,7 @@ def text_to_dict(text): return res for line in text.splitlines(): line = line.strip() - if line: + if line and not line.startswith('#'): key, value = [w.strip() for w in line.split('=', 1)] if key in res: try: -- cgit v1.2.1