Author: esr
Date: Mon Nov 10 12:54:00 2008
New Revision: 30690
URL: http://svn.gna.org/viewcvs/wesnoth?rev=30690&view=rev
Log:
Fix the line parser so it's not confiused by a comment on a line of
its own that contains an =.
Modified:
trunk/data/tools/wesnoth/wmltools.py
Modified: trunk/data/tools/wesnoth/wmltools.py
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wesnoth/wmltools.py?rev=30690&r1=30689&r2=30690&view=diff
==============================================================================
--- trunk/data/tools/wesnoth/wmltools.py (original)
+++ trunk/data/tools/wesnoth/wmltools.py Mon Nov 10 12:54:00 2008
@@ -43,13 +43,13 @@
value = value.strip()
return string_strip(value)
-def parse_attribute(str):
+def parse_attribute(line):
"Parse a WML key-value pair from a line."
- if '=' not in str:
+ if '=' not in line or line.find("#") > -1 and line.find("#") <
line.find("="):
return None
- where = str.find("=")
- leader = str[:where]
- after = str[where+1:]
+ where = line.find("=")
+ leader = line[:where]
+ after = line[where+1:]
after = after.lstrip()
if "#" in after:
where = after.find("#")
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits