summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Th?nault <sylvain.thenault@logilab.fr>2010-10-11 09:36:40 +0200
committerSylvain Th?nault <sylvain.thenault@logilab.fr>2010-10-11 09:36:40 +0200
commite3eae39392a1843457cd865b4a29e5c7538fd0a7 (patch)
tree2e1333dd11b660bd2d9835bd7e4d41ab3393675b
parent4142bc20473def96e9dfca3dc280308a91f4b090 (diff)
downloadlogilab-common-e3eae39392a1843457cd865b4a29e5c7538fd0a7.tar.gz
skip comments (eg lines starting with a #) in text_to_dict
-rw-r--r--textutils.py2
1 files changed, 1 insertions, 1 deletions
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: