Skip to content

Commit

Permalink
Fix parsing of input
Browse files Browse the repository at this point in the history
  • Loading branch information
drummerdoc committed Jul 29, 2020
1 parent a2c6680 commit 438868c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions chemPathTool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1520,13 +1520,16 @@ def doReadEDat(self,ifile):
f = open(infile,'r')
lines = f.readlines()
label = lines[0].strip()
nodes = lines[1].strip().split(' ')
nodes = lines[1].strip().split()
for line in lines[2:]:
vals = line.strip().split(' ')
vals = line.strip().split()
if (len(vals) == 4):
edgeVals.append((vals[0],vals[1],float(vals[2]),float(vals[3])))
elif (len(vals) == 3):
edgeVals.append((vals[0],vals[1],float(vals[2]),0.0))
else:
print 'oops, bad input data'
print 'bad input line - expecting 2 strings, and either one or two floats.'
print 'Found: ',line
f.close()

widget = ChemPathTool (root, nodes, edgeVals, label)
Expand Down

0 comments on commit 438868c

Please sign in to comment.