comparison validate_affy_metadata.py @ 7:31b9f0a18a15 draft

Uploaded
author greg
date Wed, 14 Nov 2018 15:00:38 -0500
parents 11d22a27c24a
children 0735cfcc7490
comparison
equal deleted inserted replaced
6:11d22a27c24a 7:31b9f0a18a15
30 sys.exit(msg) 30 sys.exit(msg)
31 31
32 32
33 def validate_date_string(line_no, date_string, accumulated_msgs): 33 def validate_date_string(line_no, date_string, accumulated_msgs):
34 try: 34 try:
35 datetime.datetime.strptime(date_string, '%Y/%m/%d') 35 datetime.datetime.strptime(date_string, '%y/%m/%d')
36 return accumulated_msgs 36 return accumulated_msgs
37 except ValueError: 37 except ValueError:
38 return add_error_msg(accumulated_msgs, "Line %d contains an incorrect date format (must be YY/MM/DD)." % line_no) 38 return add_error_msg(accumulated_msgs, "Line %d contains an incorrect date format (%s must be YY/MM/DD)." % (line_no, date_string))
39 39
40 40
41 def validate_decimal(line_no, decimal_string, accumulated_msgs): 41 def validate_decimal(line_no, decimal_string, accumulated_msgs):
42 try: 42 try:
43 decimal.Decimal(decimal_string) 43 decimal.Decimal(decimal_string)