Skip to content

Commit

Permalink
don't strip whitespace from field names
Browse files Browse the repository at this point in the history
  • Loading branch information
jessica-azgs committed Jan 5, 2015
1 parent 8973d35 commit 18f48b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
8 changes: 2 additions & 6 deletions usginmodels/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand All @@ -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 = ""

Expand Down

0 comments on commit 18f48b0

Please sign in to comment.