diff --git a/worldbuild-manager.py b/worldbuild-manager.py index 361b272..400a31f 100755 --- a/worldbuild-manager.py +++ b/worldbuild-manager.py @@ -188,7 +188,7 @@ try: name = ew + norm(abs(j), 3) + ns + norm(abs(i), 2) - if not name in state or (name in state and state[name]["status"] != "done"): + if not name in state or (name in state and state[name]["status"] != "done" and (state[name]["status"] != "skip" or get == "skip")): if ns == "s": ns_step = -1 else: @@ -204,7 +204,7 @@ try: iii = abs(i) for l in range(0, 10): name_minor = ew + norm(j, 3) + ns + norm(iii, 2) - if not name in state or (not name_minor in state[name] or (name_minor in state[name] and (state[name][name_minor]["status"] == get))): + if not name in state or (not name_minor in state[name] or (name_minor in state[name] and (state[name][name_minor]["status"] == get or state[name][name_minor]["status"] == "pending"))): tile = name_minor break iii += ns_step diff --git a/worldbuild-worker.py b/worldbuild-worker.py index 70d7a3c..e6b5ec7 100755 --- a/worldbuild-worker.py +++ b/worldbuild-worker.py @@ -16,7 +16,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. import os -from subprocess import run, Popen +from subprocess import run, Popen, STDOUT import sys import socket import re @@ -156,7 +156,7 @@ while running: else: bounds = "bounds=" - bounds += str(ew_val) + "_" + str(ns_val) + "_" + str(ew_val + 10) + "_" + str(ns_val + 10) + bounds += str(ew_val) + "_" + str(ns_val) + "_" + str(ew_val + 1) + "_" + str(ns_val + 1) if ew_val % 10 != 0: ew_val = ew_val - (ew_val % 10) @@ -169,7 +169,12 @@ while running: run("echo '" + bounds + "' > projects/worldbuild-" + name + "/settings", shell=True) - build = Popen("./build -S 10 -t 1 worldbuild-" + name, shell=True, start_new_session=True) + print("Building " + name) + + with open("projects/worldbuild/output/" + name + ".log", "w") as log_file: + build = Popen("./build -S 10 -t 1 worldbuild-" + name, stdout=log_file, stderr=STDOUT, shell=True, start_new_session=True) + + build.wait() cleanup()