summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Chakradeo <amit@chakradeo.net>2011-02-18 06:47:13 -0800
committerAmit Chakradeo <amit@chakradeo.net>2011-02-18 06:47:13 -0800
commit9de21094a8cf565bdfcf75688e121a5ad1f5397b (patch)
tree083add4df7658f11902a3f20275cccc1994c9cd1
parentd7c771bfbc7e7a2a0b58089b32f6013ce5109c72 (diff)
downloadplanetpixels-9de21094a8cf565bdfcf75688e121a5ad1f5397b.tar.gz
planetpixels-9de21094a8cf565bdfcf75688e121a5ad1f5397b.tar.bz2
Use config.has_section() instead of a separate dict
-rwxr-xr-xplanet/csv_config.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/planet/csv_config.py b/planet/csv_config.py
index 29de08a..9f905a6 100755
--- a/planet/csv_config.py
+++ b/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)