From 75ac117b996561aea48d7c30c2ebdb6db8177c14 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sat, 12 Sep 2009 10:48:25 -0400 Subject: [PATCH] Added the StringUtils module with the is_integer() function. Imported StringUtils into SummaryFile1. Removed the InvalidAreaError, since we need to accept areas of zero. --- src/StringUtils.py | 7 +++++++ src/SummaryFile1.py | 12 +++++------- 2 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 src/StringUtils.py diff --git a/src/StringUtils.py b/src/StringUtils.py new file mode 100644 index 0000000..871f3fc --- /dev/null +++ b/src/StringUtils.py @@ -0,0 +1,7 @@ +def is_integer(s): + try: + x = int(s) + return True + except: + return False + diff --git a/src/SummaryFile1.py b/src/SummaryFile1.py index bd69d00..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: @@ -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 -- 2.43.2