Fix db name issue
Signed-off-by: fly <merspieler@airmail.cc>
This commit is contained in:
parent
913e309a19
commit
eb202cf64f
1 changed files with 7 additions and 1 deletions
|
@ -54,6 +54,12 @@ while i < argc:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
|
def norm(num, length):
|
||||||
|
num = str(abs(num))
|
||||||
|
while len(num) < length:
|
||||||
|
num = "0" + num
|
||||||
|
return num
|
||||||
|
|
||||||
def send_status(name, status):
|
def send_status(name, status):
|
||||||
try:
|
try:
|
||||||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
|
@ -104,7 +110,7 @@ else:
|
||||||
if ns_val % 10 != 0:
|
if ns_val % 10 != 0:
|
||||||
ns_val = ns_val - (ns_val % 10)
|
ns_val = ns_val - (ns_val % 10)
|
||||||
|
|
||||||
db_name = prefix + ew + str(abs(ew_val)) + ns + str(abs(ns_val))
|
db_name = prefix + ew + norm(ew_val, 3) + ns + norm(ns_val, 2)
|
||||||
|
|
||||||
os.system("sed -i 's/DB_NAME.*/DB_NAME = \"" + db_name + "\"/' projects/worldbuild-" + name + "/params.ini")
|
os.system("sed -i 's/DB_NAME.*/DB_NAME = \"" + db_name + "\"/' projects/worldbuild-" + name + "/params.ini")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue