Mercurial > repos > greg > validate_temperature_data
comparison validate_temperature_data.py @ 4:9ca3ff390666 draft
Uploaded
| author | greg |
|---|---|
| date | Tue, 27 Nov 2018 09:55:22 -0500 |
| parents | 3de939253e55 |
| children | 467305a51829 |
comparison
equal
deleted
inserted
replaced
| 3:3de939253e55 | 4:9ca3ff390666 |
|---|---|
| 45 | 45 |
| 46 | 46 |
| 47 def validate_integer(line_no, integer_string, accumulated_msgs, label): | 47 def validate_integer(line_no, integer_string, accumulated_msgs, label): |
| 48 if integer_string.isdigit(): | 48 if integer_string.isdigit(): |
| 49 return accumulated_msgs | 49 return accumulated_msgs |
| 50 return add_error_msg(accumulated_msgs, "Line %d contains an incorrect %s integer value (%s)." % (line_no, label, decimal_string)) | 50 return add_error_msg(accumulated_msgs, "Line %d contains an incorrect %s integer value (%s)." % (line_no, label, integer_string)) |
| 51 | 51 |
| 52 | 52 |
| 53 def validate_mmdd(line_no, mmdd, accumulated_msgs): | 53 def validate_mmdd(line_no, mmdd, accumulated_msgs): |
| 54 try: | 54 try: |
| 55 datetime.datetime.strptime(mmdd, '%m-%d') | 55 datetime.datetime.strptime(mmdd, '%m-%d') |
