diff options
author | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2010-10-11 09:36:40 +0200 |
---|---|---|
committer | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2010-10-11 09:36:40 +0200 |
commit | e3eae39392a1843457cd865b4a29e5c7538fd0a7 (patch) | |
tree | 2e1333dd11b660bd2d9835bd7e4d41ab3393675b /textutils.py | |
parent | 4142bc20473def96e9dfca3dc280308a91f4b090 (diff) | |
download | logilab-common-e3eae39392a1843457cd865b4a29e5c7538fd0a7.tar.gz |
skip comments (eg lines starting with a #) in text_to_dict
Diffstat (limited to 'textutils.py')
-rw-r--r-- | textutils.py | 2 |
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: |