campaign2wiki: minor syntax cleanup
This commit is contained in:
parent
6ebe88492d
commit
d80c80a50f
1 changed files with 6 additions and 7 deletions
|
@ -30,10 +30,9 @@ def wiki_output(campaign):
|
|||
Takes a campaign instance and outputs information in wiki format
|
||||
"""
|
||||
# Remove Espreon fancy but bug-inducing characters
|
||||
# FIXME: This is not elegant at all, find a better way to do it
|
||||
for i in (u"’", u"—", u'‘'):
|
||||
campaign.name = ''.join(campaign.name.split(i))
|
||||
campaign.description = ''.join(campaign.description.split(i))
|
||||
for char in ("’", "—", '‘'):
|
||||
campaign.name = campaign.name.replace(char, "")
|
||||
campaign.description = campaign.description.replace(char, "")
|
||||
text = """== {0} ==
|
||||
{1}
|
||||
|
||||
|
@ -57,12 +56,12 @@ which generates information about campaigns for the wiki.')
|
|||
dest='wesnoth', help='The wesnoth executable location')
|
||||
args = arg_parser.parse_args()
|
||||
|
||||
output = '{{Autogenerated}} '
|
||||
output = ['{{Autogenerated}} ']
|
||||
main = wmlparser3.Parser(args.wesnoth, None, None)
|
||||
main.parse_file('data/_main.cfg')
|
||||
for campaign in main.get_all(tag='campaign'):
|
||||
a = Campaign(campaign)
|
||||
output += wiki_output(a)
|
||||
output.append(wiki_output(a))
|
||||
|
||||
with open(args.output_path, "w") as wiki_format:
|
||||
wiki_format.write(output)
|
||||
wiki_format.write(''.join(output))
|
||||
|
|
Loading…
Add table
Reference in a new issue