bzr revid: fp@tinyerp.com-20081123111128-a2vqz7wf6w89popv
This commit is contained in:
Fabien Pinckaers 2008-11-23 12:11:28 +01:00
parent 21a9b9e064
commit a2fddb8b40
1 changed files with 5 additions and 8 deletions

View File

@ -100,18 +100,15 @@ class TinyPoFile(object):
else:
tmp_tnrs = []
line = None
while not line:
while (not line):
if 0 == len(self.lines):
raise StopIteration()
line = self.lines.pop(0).strip()
while line.startswith('#'):
if line.startswith('#:'):
if line.startswith('#:'):
tmp_tnrs.append( line[2:].strip().split(':') )
line = self.lines.pop(0).strip()
while (not line) and self.lines:
# allow empty lines between comments and msgid
line = self.lines.pop(0).strip()
if line.startswith('#'):
line = None
if not line.startswith('msgid'):
raise Exception("malformed file: bad line: %s" % line)
source = unquote(line[6:])