X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FSummaryFile1.py;h=0ad410d0dc4152b6642d96fb10c3b9647e466c3c;hb=75ac117b996561aea48d7c30c2ebdb6db8177c14;hp=3c82186474108e72908d3d3ded341d48470c1409;hpb=67ebbeeaad11d0c1c934c07692e932708aa3aecf;p=dead%2Fcensus-tools.git diff --git a/src/SummaryFile1.py b/src/SummaryFile1.py index 3c82186..0ad410d 100644 --- a/src/SummaryFile1.py +++ b/src/SummaryFile1.py @@ -1,9 +1,10 @@ -import os, GPS, inspect +import os + +import GPS +import StringUtils -class RecordError(StandardError): - pass -class InvalidAreaError(StandardError): +class RecordError(StandardError): pass class GeoRecord: @@ -11,7 +12,7 @@ class GeoRecord: This class wraps one record in an SF1 geo file. """ - MinimumLineLength = 400 + MINIMUM_LINE_LENGTH = 400 class Block: @@ -83,9 +84,6 @@ class GeoRecordParser: except ValueError: # A value couldn't be converted to the appropriate type. continue - except InvalidAreaError: - # Something is funny with the geometry. - continue return blocks @@ -98,8 +96,8 @@ class GeoRecordParser: allow the GeoRecord class to parse the data meaningfully and throw an error if something doesn't look right. """ - if (len(line) < GeoRecord.MinimumLineLength): - raise RecordError("The input line is too short. The SF1 specification requires a line length of %d characters; this line contains only %d characters" % (GeoRecord.MinimumLineLength, len(line))) + if (len(line) < GeoRecord.MINIMUM_LINE_LENGTH): + raise RecordError("The input line is too short. The SF1 specification requires a line length of %d characters; this line contains only %d characters" % (GeoRecord.MINIMUM_LINE_LENGTH, len(line))) record = GeoRecord()