From 6ff4db3abdcf09a51a2d769948f972badafff074 Mon Sep 17 00:00:00 2001 From: fly Date: Thu, 27 Aug 2020 11:09:40 +0000 Subject: [PATCH] Bug fixes Signed-off-by: fly --- worldbuild-worker.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/worldbuild-worker.py b/worldbuild-worker.py index 424d1ec..5cfbfee 100755 --- a/worldbuild-worker.py +++ b/worldbuild-worker.py @@ -22,7 +22,7 @@ import socket import re from time import sleep, strftime, time -from common import send_status, get_job, norm, get_south, get_west, get_east, get_north +from common import send_status, get_job, norm, get_south, get_west, get_east, get_north, get_area_name action = "pending" host = socket.gethostname() @@ -78,7 +78,7 @@ while i < argc: def cleanup(): if os.path.isfile("projects/worldbuild-" + name + "/osm2city-exceptions.log"): - run("mv projects/worldbuild-" + name + "/osm2city-exceptions.log projects/worldbuild/output/error/" + name + "-" + strftime("%Y%m%d-%H%M", time()) + ".exceptions.log", shell=True) + run("mv projects/worldbuild-" + name + "/osm2city-exceptions.log projects/worldbuild/output/error/" + name + "-" + strftime("%Y%m%d-%H%M") + ".exceptions.log", shell=True) run("rm -rf projects/worldbuild-" + name, shell=True) @@ -105,7 +105,7 @@ while running: print("ERROR: Invalid tile name") sys.exit(1) else: - db_name = prefix + get_area_name(name, major=True) + db_name = prefix + get_area_name(get_south(name), get_west(name), major=True) if get_west(name) < 0: bounds = "bounds=*" @@ -121,9 +121,9 @@ while running: if not quiet: print("Building " + name) - logpath = "projects/worldbuild/output/" + get_area_name(name, major=True) + "/" + get_area_name(name) + "/" + logpath = "projects/worldbuild/output/" + get_area_name(get_south(name), get_west(name), major=True) + "/" + get_area_name(get_south(name), get_west(name)) + "/" run("mkdir -p " + logpath, shell=True) - with open(logpath + name + "-" + strftime("%Y%m%d-%H%M", time()) + ".log", "w") as log_file: + with open(logpath + name + "-" + strftime("%Y%m%d-%H%M") + ".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()