Skip to content

Commit

Permalink
added ignore option
Browse files Browse the repository at this point in the history
  • Loading branch information
TimGoll committed Oct 28, 2023
1 parent 10de6fb commit 9ad78b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

A python tool that parses the language files and cleans them up

Run: `clear ; python parse.py --in "../TTT2/lua/terrortown/lang" --out "../TTT2/lua/terrortown/lang" --base "en"`
Run: `python parse.py --in "../TTT2/lua/terrortown/lang" --out "../TTT2/lua/terrortown/lang" --base en --ignore chef`
4 changes: 4 additions & 0 deletions parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
parser.add_argument("--in", help="A path to the input folder", type=str, dest="input")
parser.add_argument("--out", help="A path to the output folder", type=str, dest="output")
parser.add_argument("--base", help="The name of the base language", type=str)
parser.add_argument("--ignore", help="Ignore the given file", type=str, nargs="+")
args = parser.parse_args()

lang_file_list = os.listdir(args.input)
Expand All @@ -25,6 +26,9 @@
if lang_file == base_file:
continue

if args.ignore and lang_file.split(".")[0] in args.ignore:
continue

lang = loadfile.loadfile(args.input + "/" + lang_file)

if not lang:
Expand Down

0 comments on commit 9ad78b5

Please sign in to comment.