Update deprecated path options

This commit is contained in:
Gunter Labes 2021-06-26 20:18:38 +02:00
parent d96ac0431a
commit 6c9813af8e
No known key found for this signature in database
GPG key ID: C0C7B971CC910216
2 changed files with 6 additions and 6 deletions

View file

@ -8,14 +8,14 @@ import sys, os, re, glob, shutil, copy, subprocess
import wesnoth.wmlparser3 as wmlparser3
def get_datadir(wesnoth_exe):
p = subprocess.Popen([wesnoth_exe, "--path"],
p = subprocess.Popen([wesnoth_exe, "--data-path"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out, err = p.communicate()
return out.strip()
def get_userdir(wesnoth_exe):
p = subprocess.Popen([wesnoth_exe, "--config-path"],
p = subprocess.Popen([wesnoth_exe, "--userdata-path"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out, err = p.communicate()

View file

@ -561,9 +561,9 @@ if __name__ == '__main__':
ap = argparse.ArgumentParser()
ap.add_argument("-C", "--config-dir",
help="Specify the user configuration dir (wesnoth --config-path).")
help="Specify the user configuration dir (wesnoth --userdata-path).")
ap.add_argument("-D", "--data-dir",
help="Specify the wesnoth data dir (wesnoth --path).")
help="Specify the wesnoth data dir (wesnoth --data-path).")
ap.add_argument("-l", "--language", default="all",
help="Specify a language to use. Else output is produced for all languages.")
ap.add_argument("-o", "--output",
@ -616,11 +616,11 @@ if __name__ == '__main__':
options.wesnoth = "wesnoth"
if not options.data_dir:
options.data_dir = shell_out([options.wesnoth, "--path"]).strip().decode("utf8")
options.data_dir = shell_out([options.wesnoth, "--data-path"]).strip().decode("utf8")
print("Using " + options.data_dir + " as data dir.")
if not options.config_dir:
options.config_dir = shell_out([options.wesnoth, "--config-path"]).strip().decode("utf8")
options.config_dir = shell_out([options.wesnoth, "--userdata-path"]).strip().decode("utf8")
print("Using " + options.config_dir + " as config dir.")
if not options.transdir: