mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-19 14:49:07 +00:00
updated wmlunits addon blacklisting script
This commit is contained in:
parent
987cc9da3c
commit
003b56cb17
@ -16,7 +16,8 @@ g = G()
|
|||||||
|
|
||||||
def parse_test(wml, d):
|
def parse_test(wml, d):
|
||||||
all = []
|
all = []
|
||||||
g.p = wmlparser2.Parser(options.wesnoth)
|
g.p = wmlparser2.Parser(options.wesnoth, options.config_dir,
|
||||||
|
options.data_dir, no_preprocess = False)
|
||||||
try:
|
try:
|
||||||
g.p.parse_text(wml, d)
|
g.p.parse_text(wml, d)
|
||||||
except wmlparser2.WMLError as e:
|
except wmlparser2.WMLError as e:
|
||||||
@ -29,6 +30,7 @@ def parse_test(wml, d):
|
|||||||
return all
|
return all
|
||||||
|
|
||||||
def get_userdir():
|
def get_userdir():
|
||||||
|
if options.config_dir: return config_dir
|
||||||
p = subprocess.Popen([options.wesnoth, "--config-path"],
|
p = subprocess.Popen([options.wesnoth, "--config-path"],
|
||||||
stdout = subprocess.PIPE, stderr = subprocess.PIPE)
|
stdout = subprocess.PIPE, stderr = subprocess.PIPE)
|
||||||
out, err = p.communicate()
|
out, err = p.communicate()
|
||||||
@ -102,13 +104,15 @@ def check_runaway():
|
|||||||
def main():
|
def main():
|
||||||
global options
|
global options
|
||||||
p = optparse.OptionParser()
|
p = optparse.OptionParser()
|
||||||
|
p.add_option("-C", "--config-dir",
|
||||||
|
help = "Specify the user configuration dir (wesnoth --config-path).")
|
||||||
|
p.add_option("-D", "--data-dir",
|
||||||
|
help = "Specify the wesnoth data dir (wesnoth --path).")
|
||||||
p.add_option("-d", "--directory",
|
p.add_option("-d", "--directory",
|
||||||
help = "First move all add-ons into the wesnoth add-ons folder and "
|
help = "First move all add-ons into the wesnoth add-ons folder and "
|
||||||
"this script will then move broken ones to the specified directory.")
|
"this script will then move broken ones to the specified directory.")
|
||||||
p.add_option("-w", "--wesnoth")
|
p.add_option("-w", "--wesnoth")
|
||||||
p.add_option("-r", "--runaway", help = "First move all addons into the "
|
p.add_option("-r", "--runaway")
|
||||||
"given folder and the ones without runaway units will be "
|
|
||||||
"moved into the wesnoth add-ons folder by this script.")
|
|
||||||
options, args = p.parse_args()
|
options, args = p.parse_args()
|
||||||
|
|
||||||
if not options.wesnoth:
|
if not options.wesnoth:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user