Changeset 2463 for trunk/imports/G2pwd_csv.py
- Timestamp:
- Sep 8, 2016 11:17:54 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/imports/G2pwd_csv.py
r2462 r2463 34 34 # Validate the contents -- make sure we only have valid lines 35 35 def ContentsValidator(self, filepointer): 36 good = 0 37 for i,S in enumerate(filepointer): 38 if i > 1000: break 39 vals = S.replace(',',' ').replace(';',' ').split() 40 if len(vals) >= 2: 41 for j,v in enumerate(vals): 42 if j == 3: break 43 try: 44 float(v) 45 except ValueError: 46 if good > 1: return False 47 continue 48 good += 1 49 continue 50 elif good > 1: 51 return False 36 52 return True # no errors encountered 37 53
Note: See TracChangeset
for help on using the changeset viewer.