From 982b30b5bd998a114b9b75708977c37df0406b36 Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Tue, 6 Jun 2017 11:45:40 +0100 Subject: [PATCH] Corrected bug with replacing #rx_box command for 3D models. --- tools/inputfile_old2new.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/inputfile_old2new.py b/tools/inputfile_old2new.py index d7324f48..e657e7c4 100644 --- a/tools/inputfile_old2new.py +++ b/tools/inputfile_old2new.py @@ -148,9 +148,12 @@ while(lindex < len(inputlines)): if model2D: # Syntax of old command: #rx_box: x1 y1 x2 y2 dx dy replacement = '#rx_array: {} {} {} {} {} {} {} {} {}'.format(params[0], params[1], 0, params[2], params[3], dx_dy_dz[2], params[4], params[5], dx_dy_dz[2]) - print("Command '{}', replaced with '{}'".format(inputlines[lindex], replacement)) - inputlines.pop(lindex) - inputlines.insert(lindex, replacement) + else + # Syntax of old command: #rx_box: x1 y1 z1 x2 y2 z2 dx dy dz + replacement = '#rx_array: {} {} {} {} {} {} {} {} {}'.format(params[0], params[1], params[2], params[3], params[4], params[5], params[6], params[7], params[8]) + print("Command '{}', replaced with '{}'".format(inputlines[lindex], replacement)) + inputlines.pop(lindex) + inputlines.insert(lindex, replacement) lindex += 1 elif cmdname == '#tx_steps':