From a2fddb8b40a66f5155eece653bb5eee568d627dc Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Sun, 23 Nov 2008 12:11:28 +0100 Subject: [PATCH] bugfix bzr revid: fp@tinyerp.com-20081123111128-a2vqz7wf6w89popv --- bin/tools/translate.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/bin/tools/translate.py b/bin/tools/translate.py index b222daed5ac..b22d12a136e 100644 --- a/bin/tools/translate.py +++ b/bin/tools/translate.py @@ -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:])