Author: iwontbecreative
Date: Sun Nov 6 04:27:35 2011
New Revision: 51882
URL: http://svn.gna.org/viewcvs/wesnoth?rev=51882&view=rev
Log:
Made code easier to read, removed an unused class. (Output does not change)
Modified:
trunk/data/tools/about_cfg_to_wiki
Modified: trunk/data/tools/about_cfg_to_wiki
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/about_cfg_to_wiki?rev=51882&r1=51881&r2=51882&view=diff
==============================================================================
--- trunk/data/tools/about_cfg_to_wiki (original)
+++ trunk/data/tools/about_cfg_to_wiki Sun Nov 6 04:27:35 2011
@@ -33,9 +33,13 @@
options.wesnoth = "./wesnoth"
# Parse WML.
- class Section: pass
- class Entry: pass
+ class Section:
+ def __init__(self, title):
+ self.title = title
+ self.lines = []
+
chapters = []
+
for arg in files:
sections = []
wml_parser = wmldata.Parser(options.wesnoth, None, None, False)
@@ -48,9 +52,7 @@
continue
wml = wml[0]
for about in wml.get_all(tag="about"):
- section = Section()
- section.title = about.get_text_val("title")
- section.lines = []
+ section = Section(about.get_text_val("title"))
for entry in about.get_all(tag="entry"):
name = entry.get_text_val("name")
comment = entry.get_text_val("comment", "")
@@ -88,7 +90,7 @@
beautified = path[slash2 + 1:slash1]
beautified = beautified.replace("_", " ")
beautified = beautified[0].upper() + beautified[1:]
- output("== " + beautified + " ==\n")
+ output("== %s ==\n" % beautified)
for section in sections:
output("=== %s ===\n" % section.title)
for name, comment, wikiuser, email in section.lines:
@@ -113,10 +115,9 @@
if "(" in name:
name, nick = name.split("(", 1)
name = name.strip()
- name = "[mailto:" + email + " " + name + "]"
- name += " (" + nick
+ name = "[mailto:%s %s] (%s" % (email, name, nick)
else:
- name = "[mailto:" + email + " " + name + "]"
+ name = "[mailto:%s %s]" % (email, name)
output("* %s%s\n" % (name, comment))
output("""[[Category:Generated]]""")
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits