Mercurial > hg > nsaunier > traffic-intelligence
comparison python/storage.py @ 722:49e99ca34a7d
corrected bugs in old ubc code
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Wed, 05 Aug 2015 00:12:52 -0400 |
| parents | 2cd245cb780d |
| children | 967d244968a4 |
comparison
equal
deleted
inserted
replaced
| 721:52272f6bf62a | 722:49e99ca34a7d |
|---|---|
| 652 s = f.readline() | 652 s = f.readline() |
| 653 while (len(s) > 0) and s[0] in commentCharacters: | 653 while (len(s) > 0) and s[0] in commentCharacters: |
| 654 s = f.readline() | 654 s = f.readline() |
| 655 return s.strip() | 655 return s.strip() |
| 656 | 656 |
| 657 def getLines(f, commentCharacters = commentChar): | 657 def getLines(f, delimiterChar = delimiterChar, commentCharacters = commentChar): |
| 658 '''Gets a complete entry (all the lines) in between delimiterChar.''' | 658 '''Gets a complete entry (all the lines) in between delimiterChar.''' |
| 659 dataStrings = [] | 659 dataStrings = [] |
| 660 s = readline(f, commentCharacters) | 660 s = readline(f, commentCharacters) |
| 661 while len(s) > 0: | 661 while len(s) > 0 and s[0] != delimiterChar: |
| 662 dataStrings += [s.strip()] | 662 dataStrings += [s.strip()] |
| 663 s = readline(f, commentCharacters) | 663 s = readline(f, commentCharacters) |
| 664 return dataStrings | 664 return dataStrings |
| 665 | 665 |
| 666 def writeList(filename, l): | 666 def writeList(filename, l): |
