Skip to content
Browse files

Use config.has_section() instead of a separate dict

  • Loading branch information...
1 parent d7c771b commit 9de21094a8cf565bdfcf75688e121a5ad1f5397b @amit committed Feb 18, 2011
Showing with 1 addition and 3 deletions.
  1. +1 −3 planet/csv_config.py
View
4 planet/csv_config.py
@@ -11,12 +11,10 @@ def csv2config(input, config=None):
config = ConfigParser()
reader = csv.DictReader(input)
- d = {}
for row in reader:
section = row[reader.fieldnames[0]]
- if not d.get(section):
+ if not config.has_section(section):
config.add_section(section)
- d[section] = 1
for name, value in row.items():
if value and name != reader.fieldnames[0]:
config.set(section, name, value)

0 comments on commit 9de2109

Please sign in to comment.
Something went wrong with that request. Please try again.