From 62ffa4cc851679d38c3a996fc7329898e331623d Mon Sep 17 00:00:00 2001 From: merspieler Date: Sat, 27 Apr 2019 14:32:17 +0000 Subject: [PATCH] Optional exclude file Signed-off-by: merspieler --- scripts/worldbuild.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/scripts/worldbuild.py b/scripts/worldbuild.py index f0dd495..f149013 100755 --- a/scripts/worldbuild.py +++ b/scripts/worldbuild.py @@ -19,6 +19,7 @@ import os import sys import math import re +import json CHUNK_SIZE = 5 @@ -143,8 +144,14 @@ def norm(num, length): num = "0" + num return num +# Get exclude file +if os.path.isfile("projects/worldbuild/exclude"): + with open("projects/worldbuild/exclude") as json_data: + exclude = json.load(json_data) +else: + exclude = [] + # Build poles first -# TODO use chunksize 180 for poles run_all("n-pole", -180, 80, 180, 90, 180) run_all("s-pole", -180, -90, 180, -80, 180) @@ -163,7 +170,14 @@ for i in range(-8, 8): name = ew + norm(abs(j), 3) + ns + norm(abs(i), 2) - run_all(name, j, i, j + 10, i + 10, CHUNK_SIZE) + skip = False + for area in exclude: + if area == name: + skip = True + break + + if not skip: + run_all(name, j, i, j + 10, i + 10, CHUNK_SIZE)