From 67240c49478b43b674b3a0b15a90753351d2dbc7 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Mon, 17 Jun 2013 14:20:38 +0000 Subject: [PATCH] [ck2cti] Fix handling of transport comments with no preceding space --- interfaces/python/ck2cti.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/interfaces/python/ck2cti.py b/interfaces/python/ck2cti.py index 690d76310..60f25d344 100755 --- a/interfaces/python/ck2cti.py +++ b/interfaces/python/ck2cti.py @@ -1560,13 +1560,13 @@ class Parser(object): if get_index(line, 'END') == 0: break - data = line.split() + if '!' in line: + line, comment = line.split('!', 1) + data = line.split() + [comment] + else: + data = line.split() if len(data) < 7: raise InputParseError('Unable to parse transport data: not enough parameters') - if len(data) >= 8: - # comment may contain spaces. Rejoin into a single field. - comment = ''.join(data[7:]).lstrip('!') - data = data[:7] + [comment] speciesName = data[0] if speciesName in self.speciesDict: