updated wmlunits
This commit is contained in:
parent
985b0db9b6
commit
987cc9da3c
2 changed files with 14 additions and 5 deletions
|
@ -115,16 +115,16 @@ class WesnothList:
|
|||
"""
|
||||
Lists various Wesnoth stuff like units, campaigns, terrains, factions...
|
||||
"""
|
||||
def __init__(self, wesnoth_exe, transdir):
|
||||
def __init__(self, wesnoth_exe, config_dir, data_dir, transdir):
|
||||
self.unit_lookup = {}
|
||||
self.race_lookup = {}
|
||||
self.terrain_lookup = {}
|
||||
self.movetype_lookup = {}
|
||||
self.era_lookup = {}
|
||||
self.campaign_lookup = {}
|
||||
self.parser = wmlparser2.Parser(wesnoth_exe)
|
||||
self.parser = wmlparser2.Parser(wesnoth_exe, config_dir,
|
||||
data_dir, no_preprocess = False)
|
||||
|
||||
self.parser = wmlparser2.Parser(wesnoth_exe)
|
||||
|
||||
def add_terrains(self):
|
||||
"""
|
||||
|
|
|
@ -777,7 +777,8 @@ def find_languages():
|
|||
"""
|
||||
global languages
|
||||
if languages_found: return languages_found
|
||||
parser = wmlparser2.Parser(options.wesnoth)
|
||||
parser = wmlparser2.Parser(options.wesnoth, options.config_dir,
|
||||
options.data_dir, no_preprocess = False)
|
||||
parser.parse_text("{languages}")
|
||||
|
||||
for locale in parser.get_all(tag = "locale"):
|
||||
|
@ -872,7 +873,11 @@ def copy_images():
|
|||
file(local, "w").write(url.read())
|
||||
|
||||
def parse_game():
|
||||
stuff = helpers.WesnothList(options.wesnoth, options.transdir)
|
||||
stuff = helpers.WesnothList(
|
||||
options.wesnoth,
|
||||
options.config_dir,
|
||||
options.data_dir,
|
||||
options.transdir)
|
||||
|
||||
def p(x): sys.stdout.write(x); sys.stdout.flush()
|
||||
def pn(x): print(x)
|
||||
|
@ -974,6 +979,10 @@ if __name__ == '__main__':
|
|||
gc.disable()
|
||||
|
||||
op = optparse.OptionParser()
|
||||
op.add_option("-C", "--config-dir",
|
||||
help = "Specify the user configuration dir (wesnoth --config-path).")
|
||||
op.add_option("-D", "--data-dir",
|
||||
help = "Specify the wesnoth data dir (wesnoth --path).")
|
||||
op.add_option("-l", "--language", default = "all",
|
||||
help = "Specify a language to use. Else outputs is produced for all languages.")
|
||||
op.add_option("-o", "--output",
|
||||
|
|
Loading…
Add table
Reference in a new issue