[FIX] handle the case of missing "#:" formated comment in po files

bzr revid: chs@tinyerp.com-20091210110826-he983jrra2tr4sfo
This commit is contained in:
Christophe Simonis 2009-12-10 12:08:26 +01:00
parent 19f772dcff
commit 2d4686660c
1 changed files with 8 additions and 0 deletions

View File

@ -152,8 +152,12 @@ _ = GettextAlias()
# class to handle po files
class TinyPoFile(object):
def __init__(self, buffer):
self.logger = netsvc.Logger()
self.buffer = buffer
def warn(self, msg):
self.logger.notifyChannel("i18n", netsvc.LOG_WARNING, msg)
def __iter__(self):
self.buffer.seek(0)
self.lines = self._get_lines()
@ -228,6 +232,10 @@ class TinyPoFile(object):
self.tnrs.append((t, n, r, source, trad))
self.first = False
if name is None:
self.warn('Missing "#:" formated comment for the following source:\n\t%s' % (source,))
return self.next()
return type, name, res_id, source, trad
def write_infos(self, modules):