comparison babel/messages/extract.py @ 147:63a93d33511a trunk

simplify
author pjenvey
date Wed, 20 Jun 2007 19:54:33 +0000
parents 14fe2a8fb842
children 31478eb3fb9e
comparison
equal deleted inserted replaced
144:14fe2a8fb842 147:63a93d33511a
258 if funcname and tok == OP and value == '(': 258 if funcname and tok == OP and value == '(':
259 in_args = True 259 in_args = True
260 elif tok == COMMENT: 260 elif tok == COMMENT:
261 # Strip the comment token from the line 261 # Strip the comment token from the line
262 value = value[1:].strip() 262 value = value[1:].strip()
263 if in_translator_comments is True and \ 263 if in_translator_comments and \
264 translator_comments[-1][0] == lineno - 1: 264 translator_comments[-1][0] == lineno - 1:
265 # We're already inside a translator comment, continue appending 265 # We're already inside a translator comment, continue appending
266 # XXX: Should we check if the programmer keeps adding the 266 # XXX: Should we check if the programmer keeps adding the
267 # comment_tag for every comment line??? probably not! 267 # comment_tag for every comment line??? probably not!
268 translator_comments.append((lineno, value)) 268 translator_comments.append((lineno, value))
269 continue 269 continue
270 # If execution reaches this point, let's see if comment line 270 # If execution reaches this point, let's see if comment line
271 # starts with one of the comment tags 271 # starts with one of the comment tags
272 for comment_tag in comment_tags: 272 for comment_tag in comment_tags:
273 if value.startswith(comment_tag): 273 if value.startswith(comment_tag):
274 if in_translator_comments is not True: 274 in_translator_comments = True
275 in_translator_comments = True
276 comment = value[len(comment_tag):].strip() 275 comment = value[len(comment_tag):].strip()
277 translator_comments.append((lineno, comment)) 276 translator_comments.append((lineno, comment))
278 break 277 break
279 elif funcname and in_args: 278 elif funcname and in_args:
280 if tok == OP and value == ')': 279 if tok == OP and value == ')':
Copyright (C) 2012-2017 Edgewall Software