From 18f48b0ba892c44f1a6d4b3a086cc6a04d56f858 Mon Sep 17 00:00:00 2001 From: jessica-azgs Date: Mon, 5 Jan 2015 16:00:42 -0700 Subject: [PATCH] don't strip whitespace from field names --- setup.py | 4 ++-- usginmodels/layer.py | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index 53f24d9..94a0215 100644 --- a/setup.py +++ b/setup.py @@ -5,10 +5,10 @@ setup( name = 'usginmodels', packages = ['usginmodels'], - version = '1.1.5', + version = '1.1.6', description = 'Interface for interacting with USGIN content models', author = 'Arizona Geological Survey', - author_email = 'adrian.sonnenschein@gmail.com', + author_email = 'developer@azgs.az.gov', url = 'https://github.com/usgin/usginmodels', download_url = 'https://github.com/usgin/usginmodels/tarball/1.1.5', keywords = ['usgin', 'ngds', 'azgs'], diff --git a/usginmodels/layer.py b/usginmodels/layer.py index 1dfec42..b83a59f 100644 --- a/usginmodels/layer.py +++ b/usginmodels/layer.py @@ -26,10 +26,6 @@ def validate_file(self, csv_text): srs = "" long_fields = {} - # Remove trailing and leading whitespace from field names in csv file - for i, field in enumerate(csv_text.fieldnames): - csv_text.fieldnames[i] = field.strip() - for i, row in enumerate(csv_text): rowCorrected = [] for f in self.fields[1:][:-1]: @@ -39,12 +35,12 @@ def validate_file(self, csv_text): data = row[f.field_name] except: if f.field_optional == False: - msg = "Error! " + f.field_name + " is a required field but was not found in the imported file." + msg = "Error! " + f.field_name + " is a required field but was not found in the imported file (or there is extraneous whitespace in the field name)." valid, messages = addMessage(-1, False, msg, messages) messages = format_messages(messages) return valid, messages, [], {}, "" else: - msg = "Warning! " + f.field_name + " was not found in the imported file but this is not a required field so ignoring." + msg = "Warning! " + f.field_name + " was not found in the imported file (or there is extraneous whitespace in the field name) but this is not a required field so ignoring." valid, messages = addMessage(-1, valid, msg, messages) data = ""