Converted campaign2wiki script to Python 3

This commit is contained in:
Elvish_Hunter 2016-06-21 21:57:57 +02:00
parent ad5b92392c
commit 6ebe88492d

View file

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# encoding: utf-8
"""
@ -6,15 +6,10 @@ A script that autogenerates some information about campaigns for the
CampaignInformation wiki page. The script is a WIP.
"""
from __future__ import with_statement # For python < 2.6
import os.path, sys
try:
import argparse
except ImportError:
print('Please install argparse by running "easy_install argparse"')
sys.exit(1)
import argparse
import wesnoth.wmlparser2 as wmlparser2
import wesnoth.wmlparser3 as wmlparser3
class Campaign:
@ -63,7 +58,7 @@ which generates information about campaigns for the wiki.')
args = arg_parser.parse_args()
output = '{{Autogenerated}} '
main = wmlparser2.Parser(args.wesnoth, None, None, False)
main = wmlparser3.Parser(args.wesnoth, None, None)
main.parse_file('data/_main.cfg')
for campaign in main.get_all(tag='campaign'):
a = Campaign(campaign)