From 6a60c523a39e3637e995fdc7e2f7a78e0451f635 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 20 Sep 2009 16:22:18 +0000 Subject: [PATCH] Cope better with attributes at toplevel. --- data/tools/wmlxgettext | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/data/tools/wmlxgettext b/data/tools/wmlxgettext index c8242b7f38d..53e3d209830 100755 --- a/data/tools/wmlxgettext +++ b/data/tools/wmlxgettext @@ -146,11 +146,7 @@ msgstr "" if isAttribute(nav): if verbose > 1: print "Attribute", nav, "with ancestors", nav.ancestors() - try: - attributes_stack[-1].append(nav.text.strip()) - except IndexError: - print >>sys.stderr, "wmlxgettext: Attributes without an enclosing tag." - sys.exit(1) + attributes_stack[-1].append(nav.text.strip()) get_translatables(nav, fn) elif isCloser(nav): if verbose > 1: @@ -203,8 +199,12 @@ msgstr "" if verbose: print "wmlxgettext: skipping %s, wrong domain" % fn continue + opener_stack.append(("", fn, 0)) + attributes_stack.append([]) for nav in WmllintIterator(lines, fn): handle_element(nav, fn) + opener_stack.pop() + # Debugging output if verbose: print "Translatables:"