Skip to content

Commit

Permalink
Converted campaign2wiki script to Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Elvish-Hunter committed Jun 22, 2016
1 parent ad5b923 commit 6ebe884
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions data/tools/campaign2wiki.py
@@ -1,20 +1,15 @@
#!/usr/bin/python
#!/usr/bin/python3
# encoding: utf-8

"""
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:
Expand Down Expand Up @@ -63,7 +58,7 @@ def wiki_output(campaign):
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)
Expand Down

0 comments on commit 6ebe884

Please sign in to comment.